[llvm-bugs] [Bug 51951] New: Sanitizers not using __cxa_demangle with static libc++abi

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 23 17:32:26 PDT 2021


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: unassignedbugs at nondot.org
          Reporter: leonardchan at google.com
                CC: llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210924/2572bf50/attachment.html>


More information about the llvm-bugs mailing list