Fix ASAN with new debian toolchain.

Even building standalone hello world complains "ASan runtime does
not come first in initial library list" and says to use LD_PRELOAD
without saying WHAT to set it to. This avoids that. (It breaks llvm,
but https://github.com/llvm/llvm-project/pull/98194 fixes it.)
This commit is contained in:
Rob Landley 2024-07-10 19:49:54 -05:00
parent dbd267f4b7
commit 9115abfe45

View File

@ -32,7 +32,7 @@ fi
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.)
export CFLAGS="$CFLAGS -fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls"
export CFLAGS="$CFLAGS -fsanitize=address -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -static-libasan"
export NOSTRIP=1
# Ignore leaks on exit. TODO
export ASAN_OPTIONS="detect_leaks=0"