From 89a135649b3108536787f528eaf2bf1f95e0d4f4 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:02:24 +0000 Subject: [PATCH] don't use mold when building with sanitizers Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> --- cmake/XrplSanitizers.cmake | 8 -------- cmake/XrplSettings.cmake | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/cmake/XrplSanitizers.cmake b/cmake/XrplSanitizers.cmake index 95c4e7fb7c..d86ac01a28 100644 --- a/cmake/XrplSanitizers.cmake +++ b/cmake/XrplSanitizers.cmake @@ -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) diff --git a/cmake/XrplSettings.cmake b/cmake/XrplSettings.cmake index 2550e5a4e1..a272ddcef8 100644 --- a/cmake/XrplSettings.cmake +++ b/cmake/XrplSettings.cmake @@ -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)