Skip to content

Commit

Permalink
Using tweakable variables in bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Aug 21, 2024
1 parent 87f694e commit d5e6d25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/programs/_build_clang_native.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set -ex

ROOT_DIR=$(pwd)
CC="clang-18"
LD="ld.lld-18"
CLANG="${CLANG:-clang-18}"
LD="${CLANG/clang/ld.lld}"
CFLAGS="--target=riscv64 -march=rv64imac_zba_zbb_zbc_zbs -nostdinc -isystem $ROOT_DIR/deps/musl/release/include -c -fdata-sections -ffunction-sections"
LDFLAGS="--gc-sections -nostdlib --sysroot $ROOT_DIR/deps/musl/release -L$ROOT_DIR/deps/musl/release/lib -lc -lgcc"

Expand All @@ -20,8 +20,8 @@ fi

if [ ! -d deps/musl/release ]; then
cd deps/musl
CLANG=$CC ./ckb/build.sh
CLANG=$CLANG ./ckb/build.sh
cd -
fi

$CC $CFLAGS clang_sample.c -o clang_sample.o && $LD $LDFLAGS clang_sample.o -o clang_sample && rm clang_sample.o
$CLANG $CFLAGS clang_sample.c -o clang_sample.o && $LD $LDFLAGS clang_sample.o -o clang_sample && rm clang_sample.o

0 comments on commit d5e6d25

Please sign in to comment.