Skip to content

Commit

Permalink
Pass -static flags as env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Sep 23, 2024
1 parent deeb47c commit 4a38aed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/linux/openocd/build-openocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/linux/riscv/build-riscv-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 4a38aed

Please sign in to comment.