From 9115abfe4535ce898e2b8f822fe7b9b5856f919f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 10 Jul 2024 19:49:54 -0500 Subject: [PATCH] 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.) --- scripts/portability.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/portability.sh b/scripts/portability.sh index e8ad197a..98412c76 100644 --- a/scripts/portability.sh +++ b/scripts/portability.sh @@ -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" -- 2.39.2