From 08a67492466510be945b3f2ab4d9285975cfae05 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Tue, 28 Apr 2026 15:23:30 +0100 Subject: [PATCH] Use rdynamic more --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e21d6bd71..1adaa73a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,8 +430,10 @@ endif() if(NOT MSVC) check_linker_flag(CXX "-rdynamic" SNMALLOC_LINKER_SUPPORT_RDYNAMIC) if (SNMALLOC_LINKER_SUPPORT_RDYNAMIC) - # Get better stack traces in CI and debug builds. - target_link_options(snmalloc INTERFACE $<${ci_or_debug}:-rdynamic>) + # Export all symbols from executables so that statically linked operator + # new/delete and malloc/free overrides are visible to shared libraries + # (e.g. libstdc++) that call through PLT. Also gives better stack traces. + target_link_options(snmalloc INTERFACE -rdynamic) endif() endif()