aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/make.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index 538ba121..e4333ba2 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -3,10 +3,15 @@
# Grab default values for $CFLAGS and such.
if [ ! -z "$ASAN" ]; then
- # Turn ASan on.
- CFLAGS="-fsanitize=address $CFLAGS"
- # Optional, but effectively necessary if you want useful backtraces.
- CFLAGS="-O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls $CFLAGS"
+ echo "Enabling ASan..."
+ # Turn ASan on. Everything except -fsanitize=address is optional, but
+ # but effectively required for useful backtraces.
+ asan_flags="-fsanitize=address \
+ -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls"
+ CFLAGS="$asan_flags $CFLAGS"
+ HOSTCC="$HOSTCC $asan_flags"
+ # Ignore leaks on exit.
+ export ASAN_OPTIONS="detect_leaks=0"
fi
export LANG=c