Skip to content

Commit e1c52f2

Browse files
committed
Test new OpenOCD version
Use rpi-common OpenOCD branch
1 parent 2774b73 commit e1c52f2

File tree

7 files changed

+28
-16
lines changed

7 files changed

+28
-16
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77

88
env:
99
SKIP_RISCV: 1
10-
SKIP_OPENOCD: 1
10+
SKIP_OPENOCD: 0
1111

1212
jobs:
1313
build_windows:

build_linux.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SKIP_RISCV=${SKIP_RISCV-0}
77
SKIP_OPENOCD=${SKIP_OPENOCD-0}
88

99
# Install prerequisites
10-
sudo apt install -y jq cmake libtool automake libusb-1.0-0-dev libhidapi-dev libftdi1-dev
10+
sudo apt install -y jq cmake libtool automake libusb-1.0-0-dev libhidapi-dev libftdi1-dev libjim-dev
1111
# RISC-V prerequisites
1212
sudo apt install -y autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev ninja-build git cmake libglib2.0-dev libslirp-dev
1313
# RPi Only prerequisites
@@ -35,14 +35,18 @@ do
3535

3636
echo "${href} ${tree} ${filename} ${extension} ${repodir}"
3737
rm -rf "${repodir}"
38-
git clone -b "${tree}" --depth=1 -c advice.detachedHead=false "${href}" "${repodir}"
38+
git clone -b "${tree}" --depth=1 -c advice.detachedHead=false "${href}" "${repodir}"
39+
submodules=$(echo "$repo" | jq -r .submodules)
40+
if [[ "$submodules" == "true" ]]; then
41+
git -C "${repodir}" submodule update --init --depth=1
42+
fi
3943
done < <(echo "$repos")
4044

4145

4246
cd $builddir
4347
if [[ "$SKIP_OPENOCD" != 1 ]]; then
4448
if ! ../packages/linux/openocd/build-openocd.sh; then
45-
echo "OpenOCD Build failed"
49+
echo "::error title=openocd-fail-${suffix}::OpenOCD Build Failed on Linux $(uname -m)"
4650
SKIP_OPENOCD=1
4751
fi
4852
fi

build_macos.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SKIP_RISCV=${SKIP_RISCV-0}
77
SKIP_OPENOCD=${SKIP_OPENOCD-0}
88

99
# Install prerequisites
10-
arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi --quiet
11-
arch -arm64 /opt/homebrew/bin/brew install jq libtool libusb automake hidapi --quiet
10+
arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi jimtcl --quiet
11+
arch -arm64 /opt/homebrew/bin/brew install jq libtool libusb automake hidapi jimtcl --quiet
1212
# RISC-V prerequisites
1313
echo "Listing local"
1414
ls /usr/local/bin
@@ -42,14 +42,18 @@ do
4242

4343
echo "${href} ${tree} ${filename} ${extension} ${repodir}"
4444
rm -rf "${repodir}"
45-
git clone -b "${tree}" --depth=1 -c advice.detachedHead=false "${href}" "${repodir}"
45+
git clone -b "${tree}" --depth=1 -c advice.detachedHead=false "${href}" "${repodir}"
46+
submodules=$(echo "$repo" | jq -r .submodules)
47+
if [[ "$submodules" == "true" ]]; then
48+
git -C "${repodir}" submodule update --init --depth=1
49+
fi
4650
done < <(echo "$repos")
4751

4852

4953
cd $builddir
5054
if [[ "$SKIP_OPENOCD" != 1 ]] && [[ $(uname -m) == 'arm64' ]]; then
5155
if ! ../packages/macos/openocd/build-openocd.sh; then
52-
echo "OpenOCD Build failed"
56+
echo "::error title=openocd-fail-macos::OpenOCD Build Failed on macOS"
5357
SKIP_OPENOCD=1
5458
fi
5559
fi

config/repositories.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
},
1111
{
1212
"href": "https://github.com/raspberrypi/openocd.git",
13-
"tree": "sdk-2.0.0"
13+
"tree": "rpi-common",
14+
"submodules": true
1415
},
1516
{
1617
"href": "https://github.com/riscv/riscv-gnu-toolchain.git",

packages/linux/openocd/build-openocd.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ export CFLAGS=-static
66
export LDFLAGS=-static
77

88
cd openocd
9-
sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c
109
./bootstrap
1110
./configure --disable-werror
1211
make clean
13-
make -j$(nproc)
12+
make
1413
INSTALLDIR="$PWD/../openocd-install/usr/local/bin"
1514
rm -rf "$PWD/../openocd-install"
1615
DESTDIR="$PWD/../openocd-install" make install

packages/macos/openocd/build-openocd.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
set -euo pipefail
44

55
cd openocd
6-
sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c
6+
77
./bootstrap
88
# See https://github.com/raspberrypi/openocd/issues/30
99
# ./configure --disable-werror CAPSTONE_CFLAGS="$(pkg-config capstone --cflags | sed s/.capstone\$//)"
1010
./configure --disable-werror
1111
make clean
12-
make -j$(nproc)
12+
make
1313
INSTALLDIR="$PWD/../openocd-install/usr/local/bin"
1414
rm -rf "$PWD/../openocd-install"
1515
DESTDIR="$PWD/../openocd-install" make install
@@ -22,4 +22,8 @@ libhidpath=($(otool -L $INSTALLDIR/openocd | grep libhidapi))
2222
echo ${libhidpath[0]}
2323
cp "${libhidpath[0]}" $INSTALLDIR/libhidapi.dylib
2424
install_name_tool -change "${libhidpath[0]}" @loader_path/libhidapi.dylib $INSTALLDIR/openocd
25+
libjimpath=($(otool -L $INSTALLDIR/openocd | grep libjim))
26+
echo ${libjimpath[0]}
27+
cp "${libjimpath[0]}" $INSTALLDIR/libjim0.83.dylib
28+
install_name_tool -change "${libjimpath[0]}" @loader_path/libjim0.83.dylib $INSTALLDIR/openocd
2529
install_name_tool -add_rpath @loader_path/ $INSTALLDIR/openocd

packages/windows/openocd/build-openocd.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ BUILDDIR=$(pwd)
66
INSTALLDIR="openocd-install"
77

88
cd openocd
9-
sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c
9+
1010
./bootstrap
11-
./configure --disable-werror
11+
./configure --disable-werror --enable-internal-jimtcl
1212
make clean
13-
make -j$(nproc)
13+
make
1414
DESTDIR="$BUILDDIR/$INSTALLDIR" make install
1515

1616
cd "$BUILDDIR/$INSTALLDIR/${MSYSTEM,,}/bin"

0 commit comments

Comments
 (0)