<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Sanitizers not using __cxa_demangle with static libc++abi"
href="https://bugs.llvm.org/show_bug.cgi?id=51951">51951</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Sanitizers not using __cxa_demangle with static libc++abi
</td>
</tr>
<tr>
<th>Product</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>asan
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>leonardchan@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>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
<a href="https://reviews.llvm.org/D109639">https://reviews.llvm.org/D109639</a>. It would be nice if this was addressed under
the hood without needing to change any compiler invocation (like adding `-u
__cxa_demangle` everywhere).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>