This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/62105] sanitizer libraries in wrong command line position in link spec file
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 Aug 2014 10:23:11 +0000
- Subject: [Bug driver/62105] sanitizer libraries in wrong command line position in link spec file
- Auto-submitted: auto-generated
- References: <bug-62105-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62105
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Julian Taylor from comment #0)
> when linking a file with -fsanitize=* the sanatizer library (e.g. -ltsan is
> placed before the object on the command line:
>
> gcc-4.10 test.c -fsanitize=thread -v -fPIC -shared 2>&1 | grep --color tsan
>
> [...] -ltsan /tmp/cc6ovqw5.o -lgcc --as-needed -lgcc_s [...]
This might be specific to libtsan, not all the sanitizer libs, I think tsan is
handled differently.
On a sort of not really related point, the gcc driver links -lstdc++ before
-llsan which means C++ programs linked to libstdc++ don't get the replacement
operator new from lsan, it should be -llsan -lstdc++