diff options
author | Rob Landley <rob@landley.net> | 2022-11-21 22:48:12 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2022-11-21 22:48:12 -0600 |
commit | 87b6d3f3026917501ac4cd71af8f70db5fae7c9a (patch) | |
tree | 0af81d4f1f49e2e40c7c36ae86d76459d89d3cf6 /scripts | |
parent | bec57325b5a681c56c1cc2bfed723016776cc410 (diff) | |
download | toybox-87b6d3f3026917501ac4cd71af8f70db5fae7c9a.tar.gz |
Use $CC instead of cc in probes, and don't add $ASAN to $HOSTCC.
(Yes I know kconfig is funky and needs to be replaced, but it doesn't ship.)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/portability.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/portability.sh b/scripts/portability.sh index 60c1d4b9..60a7ab11 100644 --- a/scripts/portability.sh +++ b/scripts/portability.sh @@ -2,9 +2,9 @@ source ./configure -if [ -z "$(command -v "${CROSS_COMPILE}${CC}")" ] +if [ -z "$(command -v "$CROSS_COMPILE$CC")" ] then - echo "No ${CROSS_COMPILE}${CC} found" >&2 + echo "No $CROSS_COMPILE$CC found" >&2 exit 1 fi @@ -23,16 +23,15 @@ else fi # Disable a pointless warning only clang produces -[ -n "$("$CROSS_COMPILE"cc --version | grep -w clang)" ] && +[ -n "$("$CROSS_COMPILE$CC" --version | grep -w clang)" ] && CFLAGS+=" -Wno-string-plus-int" # Address Sanitizer -if [ ! -z "$ASAN" ]; then +if [ -n "$ASAN" ]; then # Turn ASan on and disable most optimization to get more readable backtraces. # (Technically ASAN is just "-fsanitize=address" and the rest is optional.) ASAN_FLAGS="-fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls" CFLAGS="$CFLAGS $ASAN_FLAGS" - HOSTCC="$HOSTCC $ASAN_FLAGS" NOSTRIP=1 # Ignore leaks on exit. TODO export ASAN_OPTIONS="detect_leaks=0" |