kubabrecka added a comment.

Anyone who uses `-nostdlib` or `-nodefaultlibs` has to be aware that his 
program will be linked with less stuff than usual and has to expect linker 
error.  If such a user doesn’t know that ASan and TSan require a dylib on 
macOS, he should be able to figure this out from the error/warning.

That being said, I am in favor for the current patch (don’t link sanitizer 
runtime automatically with -nostdlib, but do so with an explicit 
-flink-sanitizer-runtimes), plus an explicit warning when using `-nostdlib` and 
`-fsanitize=...` together without `-flink-sanitizer-runtimes`, which should 
suggest to use the new option.

Could we consider renaming `-flink-sanitizer-runtimes` to something that starts 
with `-fsanitize`?  All current sanitizer flags start with `-fsanitize`, they 
never use the word sanitize/sanitizer in the middle.  We also already have 
`-fsanitize-link-c++-runtime`.


https://reviews.llvm.org/D24048



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to