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

Reply via email to