don't use mold when building with sanitizers

Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
This commit is contained in:
Pratik Mankawde
2025-12-16 13:02:24 +00:00
parent 755833508c
commit 89a135649b
2 changed files with 1 additions and 9 deletions

View File

@@ -112,14 +112,6 @@ endif()
# Compiler-specific configuration
if(IS_GCC)
# Remove any -fuse-ld=... flags previously added to 'common'
get_target_property(_common_if_libs common INTERFACE_LINK_LIBRARIES)
if(_common_if_libs)
message(STATUS " Can't use mold with gcc while ASAN is enabled. Will use default linker (bfd/ld).")
list(REMOVE_ITEM _common_if_libs "-fuse-ld=mold" "-fuse-ld=gold" "-fuse-ld=lld")
set_target_properties(common PROPERTIES INTERFACE_LINK_LIBRARIES "${_common_if_libs}")
endif()
# Disable mold, gold and lld linkers for GCC with sanitizers
# Use default linker (bfd/ld) which is more lenient with mixed code models
set(use_mold OFF CACHE BOOL "Use mold linker" FORCE)

View File

@@ -62,7 +62,7 @@ else()
set(wextra OFF CACHE BOOL "gcc/clang only" FORCE)
endif()
if(is_linux)
if(is_linux AND NOT $ENV{SANITIZERS})
option(BUILD_SHARED_LIBS "build shared xrpl libraries" OFF)
option(static "link protobuf, openssl, libc++, and boost statically" ON)
option(perf "Enables flags that assist with perf recording" OFF)