[compiler-rt] [asan] Build the asan_new_delete.cpp C++ slice with -frtti (PR #213077)

Justin T. Gibbs via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 12:06:52 PDT 2026


================
@@ -188,6 +188,16 @@ if(COMPILER_RT_ASAN_ENABLE_EXCEPTIONS AND COMPILER_RT_HAS_FEXCEPTIONS_FLAG)
   list(APPEND ASAN_CXX_CFLAGS -fexceptions)
   list(REMOVE_ITEM ASAN_DYNAMIC_CXX_CFLAGS -fno-exceptions)
   list(APPEND ASAN_DYNAMIC_CXX_CFLAGS -fexceptions)
+  # The throwing operator new throws std::bad_alloc. Under -fno-rtti clang emits a
+  # private type_info copy a user `catch` can't match on Mach-O. ELF avoids this
+  # only via linker coalescing of the weak copies, which is not guaranteed
+  # (e.g. defeated by `-Bsymbolic`). Build with -frtti to use libc++abi's copy.
----------------
scsiguy wrote:

Please review the latest version. It should render the intent of your change, but is slightly different than your proposed text.

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


More information about the llvm-commits mailing list