From 4a38aed566bc9b89cf94700c3e4f711d88626b87 Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Mon, 23 Sep 2024 13:48:05 +0100 Subject: [PATCH] Pass -static flags as env vars --- build_linux.sh | 3 +++ packages/linux/openocd/build-openocd.sh | 2 +- packages/linux/riscv/build-riscv-gcc.sh | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) 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)