1
0
Fork 0

Statically link libasan during ASAN builds

Some deployments of GCC won't link ASAN build without explicitly
specifying the library, and report:

  "ASan runtime does not come first in initial library list;
   you should either link runtime to your application or
   manually preload it with LD_PRELOAD"

This commit includes the asan library by default for respective
builds.
This commit is contained in:
krcroft 2020-04-12 11:08:12 -07:00 committed by Patryk Obara
parent 85517f82a9
commit 9d576b5cb7

View file

@ -30,8 +30,10 @@ cflags_fdotrain+=("${cflags[@]}" -DNDEBUG -g1 -fno-omit-frame-pointer)
cflags_optinfo+=("${cflags_release[@]}" -fopt-info-missed
-ftree-vectorizer-verbose=6)
cflags_asan+=("${cflags_debug[@]}" -fsanitize=address)
ldflags_asan+=(-static-libasan)
cflags_uasan+=("${cflags_debug[@]}" -fsanitize=address,undefined
-fsanitize-recover=signed-integer-overflow)
ldflags_uasan+=(-static-libasan)
cflags_usan+=("${cflags_debug[@]}" -fsanitize=undefined
-fsanitize-recover=signed-integer-overflow)
cflags_tsan+=("${cflags_debug[@]}" -fsanitize=thread)