[compiler-rt] [rtsan] Link in proper CXX ABI library (PR #109715)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 13:24:39 PDT 2024


https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/109715

Based on an issue reported in #109529  ([comment](https://github.com/llvm/llvm-project/pull/109529#issuecomment-2368924039), [build problem](https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-mac-x64/b8736170060997779425/blamelist) )

We seemingly were having issues with compiling/linking against different ABIs:

```
undefined symbol for arch arm64: std::__2::__libcpp_verbose_abort(
...
did you mean: std::__1::__libcpp_verbose_abort(
```

I cannot reproduce this issue locally, but this fix seems to be in the same general area.


This new pattern was found in all of the other sanitizer's cmakelists.txt, making me think this is our problem

```
nsan/CMakeLists.txt
44-
45-set(NSAN_DYNAMIC_LIBS
46:  ${COMPILER_RT_UNWINDER_LINK_LIBS}
47-  ${SANITIZER_CXX_ABI_LIBRARIES}
48-  ${SANITIZER_COMMON_LINK_LIBS})

ubsan/CMakeLists.txt
65-
66-set(UBSAN_DYNAMIC_LIBS
67:  ${COMPILER_RT_UNWINDER_LINK_LIBS}
68-  ${SANITIZER_CXX_ABI_LIBRARIES}
69-  ${SANITIZER_COMMON_LINK_LIBS})

tsan/rtl/CMakeLists.txt
14-
15-set(TSAN_DYNAMIC_LINK_LIBS
16:  ${COMPILER_RT_UNWINDER_LINK_LIBS}
17-  ${SANITIZER_CXX_ABI_LIBRARIES}
18-  ${SANITIZER_COMMON_LINK_LIBS})

asan/CMakeLists.txt
145-
146-set(ASAN_DYNAMIC_LIBS
147:  ${COMPILER_RT_UNWINDER_LINK_LIBS}
148-  ${SANITIZER_CXX_ABI_LIBRARIES}
149-  ${SANITIZER_COMMON_LINK_LIBS})
```

>From 30fd715f1204e0aca616072f5159d145c1e5fd35 Mon Sep 17 00:00:00 2001
From: Chris Apple <cja-private at pm.me>
Date: Mon, 23 Sep 2024 13:18:17 -0700
Subject: [PATCH] [rtsan] Link in proper CXX ABI library

---
 compiler-rt/lib/rtsan/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/lib/rtsan/CMakeLists.txt b/compiler-rt/lib/rtsan/CMakeLists.txt
index 0fc3a3f8f48960..d4296f56acd30d 100644
--- a/compiler-rt/lib/rtsan/CMakeLists.txt
+++ b/compiler-rt/lib/rtsan/CMakeLists.txt
@@ -27,7 +27,8 @@ set(RTSAN_CFLAGS
 set(RTSAN_LINK_FLAGS ${COMPILER_RT_COMMON_LINK_FLAGS})
 set(RTSAN_LINK_LIBS
   ${COMPILER_RT_UNWINDER_LINK_LIBS}
-  ${COMPILER_RT_CXX_LINK_LIBS})
+  ${SANITIZER_CXX_ABI_LIBRARIES}
+  ${SANITIZER_COMMON_LINK_LIBS})
 
 append_rtti_flag(OFF RTSAN_CFLAGS)
 



More information about the llvm-commits mailing list