From 4cb369851ebcb866b3e8100f274a0f1d161abe7a Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Sun, 8 Sep 2024 00:17:33 +0100 Subject: [PATCH] Revert macOS changes, and uninstall libftdi instead --- build_macos.sh | 3 +++ packages/macos/openocd/build-openocd.sh | 20 ++++++++++---------- packages/macos/riscv/build-riscv-gcc.sh | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/build_macos.sh b/build_macos.sh index cc8b4df..245068b 100755 --- a/build_macos.sh +++ b/build_macos.sh @@ -9,6 +9,9 @@ SKIP_OPENOCD=${SKIP_OPENOCD-0} # Install prerequisites arch -x86_64 /usr/local/bin/brew install jq libtool libusb automake hidapi arch -arm64 /opt/homebrew/bin/brew install jq libtool libusb automake hidapi +# Uninstall libftdi, as it's not required +arch -x86_64 /usr/local/bin/brew uninstall libftdi +arch -arm64 /opt/homebrew/bin/brew uninstall libftdi # Risc-V prerequisites echo "Listing local" ls /usr/local/bin diff --git a/packages/macos/openocd/build-openocd.sh b/packages/macos/openocd/build-openocd.sh index 68fbffc..b75db04 100755 --- a/packages/macos/openocd/build-openocd.sh +++ b/packages/macos/openocd/build-openocd.sh @@ -7,19 +7,19 @@ sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c ./bootstrap # See https://github.com/raspberrypi/openocd/issues/30 # ./configure --disable-werror CAPSTONE_CFLAGS="$(pkg-config capstone --cflags | sed s/.capstone\$//)" -./configure CFLAGS=-static LDFLAGS=-static --disable-werror +./configure --disable-werror make clean make -j$(nproc) INSTALLDIR="$PWD/../openocd-install/usr/local/bin" rm -rf "$PWD/../openocd-install" DESTDIR="$PWD/../openocd-install" make install -# libusbpath=($(otool -L $INSTALLDIR/openocd | grep libusb)) -# echo ${libusbpath[0]} -# cp "${libusbpath[0]}" $INSTALLDIR/libusb-1.0.dylib -# install_name_tool -change "${libusbpath[0]}" @loader_path/libusb-1.0.dylib $INSTALLDIR/openocd -# libhidpath=($(otool -L $INSTALLDIR/openocd | grep libhidapi)) -# echo ${libhidpath[0]} -# cp "${libhidpath[0]}" $INSTALLDIR/libhidapi.dylib -# install_name_tool -change "${libhidpath[0]}" @loader_path/libhidapi.dylib $INSTALLDIR/openocd -# install_name_tool -add_rpath @loader_path/ $INSTALLDIR/openocd +libusbpath=($(otool -L $INSTALLDIR/openocd | grep libusb)) +echo ${libusbpath[0]} +cp "${libusbpath[0]}" $INSTALLDIR/libusb-1.0.dylib +install_name_tool -change "${libusbpath[0]}" @loader_path/libusb-1.0.dylib $INSTALLDIR/openocd +libhidpath=($(otool -L $INSTALLDIR/openocd | grep libhidapi)) +echo ${libhidpath[0]} +cp "${libhidpath[0]}" $INSTALLDIR/libhidapi.dylib +install_name_tool -change "${libhidpath[0]}" @loader_path/libhidapi.dylib $INSTALLDIR/openocd +install_name_tool -add_rpath @loader_path/ $INSTALLDIR/openocd diff --git a/packages/macos/riscv/build-riscv-gcc.sh b/packages/macos/riscv/build-riscv-gcc.sh index 2a7470e..ca4f9a0 100755 --- a/packages/macos/riscv/build-riscv-gcc.sh +++ b/packages/macos/riscv/build-riscv-gcc.sh @@ -13,7 +13,7 @@ GDB_TARGET_FLAGS_EXTRA="--with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew" export GDB_TARGET_FLAGS_EXTRA cd riscv-gnu-toolchain -./configure CFLAGS=-static LDFLAGS=-static --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc +./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc # 4 threads, as 8 threads runs out of memory make -j4