https://bugs.llvm.org/show_bug.cgi?id=51951

            Bug ID: 51951
           Summary: Sanitizers not using __cxa_demangle with static
                    libc++abi
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: asan
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Sanitizers can optionally use libc++abi's demangler via __cxa_demangle if it's
available. This works for the dynamic linking case where the weak reference to
__cxa_demangle in sanitizer runtimes will use the strong definition provided by
libc++abi.so, but this will not be the case when static linking libc++abi.a.
Because the static linker does not need to resolve the weak reference to
__cxa_demangle, it will not attempt to link in libc++abi.a(cxa_demangle.cpp.o),
and __cxa_demangle will be undefined.

While this doesn't break sanitizers, it seems like an oversight in the case of
static linking. Certain tests that also expect __cxa_demangle to be defined
will break if the host toolchain is using a hermetic libc++[abi]. See
https://reviews.llvm.org/D109639. It would be nice if this was addressed under
the hood without needing to change any compiler invocation (like adding `-u
__cxa_demangle` everywhere).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to