Fix ASan linking error when compiling with gcc

This commit is contained in:
Abdelrahman Said 2025-02-22 14:58:41 +00:00
parent f9f8f092b5
commit 7df64a3168

View File

@ -19,6 +19,11 @@ CC=clang
CFLAGS="-Wall -Wextra -Werror -pedantic" CFLAGS="-Wall -Wextra -Werror -pedantic"
LIBFLAGS="-fPIC -shared" LIBFLAGS="-fPIC -shared"
if [[ $CC == "gcc" ]]; then
# Used to disable the "ASan runtime does not come first in initial library list" error when compiling with gcc
export ASAN_OPTIONS=verify_asan_link_order=0
fi
INCLUDE="$(find src -type d | xargs -I{} echo -n "-I{} ")" INCLUDE="$(find src -type d | xargs -I{} echo -n "-I{} ")"
SRC="$(find src -type f -name "*.c" | xargs -I{} echo -n "{} ")" SRC="$(find src -type f -name "*.c" | xargs -I{} echo -n "{} ")"