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

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 13:25:12 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Chris Apple (cjappl)

<details>
<summary>Changes</summary>

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})
```

---
Full diff: https://github.com/llvm/llvm-project/pull/109715.diff


1 Files Affected:

- (modified) compiler-rt/lib/rtsan/CMakeLists.txt (+2-1) 


``````````diff
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)
 

``````````

</details>


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


More information about the llvm-commits mailing list