From 7df64a3168ee739a0fbb903061af8d1f606d57ec Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sat, 22 Feb 2025 14:58:41 +0000 Subject: [PATCH] Fix ASan linking error when compiling with gcc --- compile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compile b/compile index e9281ae..46bac00 100755 --- a/compile +++ b/compile @@ -19,6 +19,11 @@ CC=clang CFLAGS="-Wall -Wextra -Werror -pedantic" 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{} ")" SRC="$(find src -type f -name "*.c" | xargs -I{} echo -n "{} ")"