diff --git a/build_linux.sh b/build_linux.sh index 30fdbe7..fa6eb50 100755 --- a/build_linux.sh +++ b/build_linux.sh @@ -6,6 +6,9 @@ set -euo pipefail SKIP_RISCV=${SKIP_RISCV-0} SKIP_OPENOCD=${SKIP_OPENOCD-0} +export CFLAGS=-static +export LDFLAGS=-static + # Install prerequisites sudo apt install -y jq cmake libtool automake libusb-1.0-0-dev libhidapi-dev libftdi1-dev # RISC-V prerequisites diff --git a/packages/linux/openocd/build-openocd.sh b/packages/linux/openocd/build-openocd.sh index d8d64dc..30e4ae7 100755 --- a/packages/linux/openocd/build-openocd.sh +++ b/packages/linux/openocd/build-openocd.sh @@ -5,7 +5,7 @@ set -euo pipefail cd openocd sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c ./bootstrap -./configure CFLAGS=-static LDFLAGS=-static --disable-werror +./configure --disable-werror make clean make -j$(nproc) INSTALLDIR="$PWD/../openocd-install/usr/local/bin" diff --git a/packages/linux/riscv/build-riscv-gcc.sh b/packages/linux/riscv/build-riscv-gcc.sh index 022ccd9..ec0ffd7 100755 --- a/packages/linux/riscv/build-riscv-gcc.sh +++ b/packages/linux/riscv/build-riscv-gcc.sh @@ -9,5 +9,5 @@ mkdir -p $INSTALLDIR BUILDDIR=$(pwd) 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 make -j$(nproc)