From ae3b36748797b562b1a1ef7fca1a26882c4e0e1c Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 29 Dec 2022 16:26:03 +0800 Subject: [PATCH] Asan: Only link by statically for asan. --- trunk/configure | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trunk/configure b/trunk/configure index d11851d8d..961d1fd9a 100755 --- a/trunk/configure +++ b/trunk/configure @@ -124,9 +124,6 @@ fi # @doc: https://github.com/google/sanitizers/wiki/AddressSanitizer if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES ]]; then CXXFLAGS="${CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer"; - if [[ $SRS_SANITIZER_STATIC == YES ]]; then - CXXFLAGS="${CXXFLAGS} -static-libasan"; - fi fi # Start to generate the Makefile. @@ -200,6 +197,11 @@ if [[ $SRS_STATIC == YES ]]; then SrsLinkOptions="${SrsLinkOptions} -static-libstdc++"; fi +# For asan(Google Address Sanitizer) +if [[ $SRS_SANITIZER == YES && $OS_IS_X86_64 == YES && $SRS_SANITIZER_STATIC == YES ]]; then + SrsLinkOptions="${SrsLinkOptions} -static-libasan"; +fi + # For coverage. if [[ $SRS_GCOV == YES ]]; then SrsLinkOptions="${SrsLinkOptions} ${SrsGcov}";