<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 5:27 PM, Stephan Bergmann <span dir="ltr"><<a href="mailto:sbergman@redhat.com" target="_blank">sbergman@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">At least on Linux,<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
clang++ -fsanitize=address test.cc<br>
</blockquote>
<br>
on<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
#include <cstddef><br>
#include <new><br>
void * operator new(std::size_t) throw (std::bad_alloc) { return 0; }<br>
int main() {}<br>
</blockquote>
<br>
fails for me with<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
/tmp/test-d17df6.o: In function `operator new(unsigned long)':<br>
test.cc:(.text+0x0): multiple definition of `operator new(unsigned long)'<br>
/home/sbergman/clang/trunk/<u></u>inst/bin/../lib/clang/3.5.0/<u></u>lib/linux/libclang_rt.asan-<u></u>x86_64.a(asan_new_delete.o):/<u></u>home/sbergman/clang/trunk/src/<u></u>projects/compiler-rt/lib/asan/<u></u>asan_new_delete.cc:62: first defined here<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
</blockquote>
<br>
Is that a known problem? </blockquote><div><br></div><div>Yes, <a href="http://llvm.org/bugs/show_bug.cgi?id=19660">http://llvm.org/bugs/show_bug.cgi?id=19660</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I assume there is no good way around it </blockquote><div><br></div><div>Yes. :( </div><div><br></div><div>--kcc </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
as the asan code is linked -whole-archive into the executable from a static archive (instead of using a dynamic library as GCC appears to do it, which also avoids the incompatibility with -z defs).<br>
<br>
Stephan<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div>