[Mesa-dev] [Bug 100120] Mesa fails to build with gcc address sanitizer (-fsanitize=address -lasan)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 9 14:58:50 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100120

--- Comment #5 from Jeff Smith <whydoubt at yahoo.com> ---
(In reply to Emil Velikov from comment #4)
> 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.

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.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170309/9369379d/attachment.html>


More information about the mesa-dev mailing list