This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug driver/62105] sanitizer libraries in wrong command line position in link spec file


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++


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]