<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Mesa fails to build with gcc address sanitizer (-fsanitize=address -lasan)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100120#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Mesa fails to build with gcc address sanitizer (-fsanitize=address -lasan)"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100120">bug 100120</a>
from <span class="vcard"><a class="email" href="mailto:whydoubt@yahoo.com" title="Jeff Smith <whydoubt@yahoo.com>"> <span class="fn">Jeff Smith</span></a>
</span></b>
<pre>(In reply to Emil Velikov from <a href="show_bug.cgi?id=100120#c4">comment #4</a>)
<span class="quote">> Note: I'm wondering if the explicit -lasan isn't agcc/clang bug. Can we get
> a reference reading why we need it, considering the explicit -f.... toggle
> we pass to gcc/clang.</span >
I don't have a reference, but from observation, -fsanitize=address does two
things:
- in the compile stage, it instruments the code, which adds references to
symbols in libasan.
- in the link stage, it adds libasan (and libdl and possibly others) to the
set of libraries to link.
Since libtool is not passing -fsanitize=address on to the compiler at link
time, the -lasan use is just one work-around.
Also, -fsanitize=address messes with configure's detection of libdl. Again, if
-fsanitize=address was working properly at link-time, it probably would not
matter.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>