[PATCH] D24048: [Driver] [Darwin] Add sanitizer libraries even if -nodefaultlibs is passed

Chris Bieneman via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 1 10:53:15 PDT 2016


beanz added a subscriber: filcab.
beanz added a comment.

To address both @bogner and @gribozavr...

The problem is we're wildly inconsistent on what -nodefaultlibs and -nostdlibs mean.

For example, on GNUTools or FreeBSD -fsanitize *always* adds sanitizer libraries regardless of the presence of the -no* flags. On Darwin we're even inconsistent among the sanitizers. The safestack library is added regardless of the flags, but the other sanitizers are not.

To answer @bogner's question about the PGO libraries, they are universally always added regardless of the -no* flags. That behavior is at least consistent across all driver implementations.

Agnostic to the discussion about a warning, I feel that this change (whether you agree with it or not) is an improvement because it at least makes the behavior of -fsanitize and the -no* flags consistent across all Driver implementations. That is significantly better than where we are today.

And in case you want to argue that maybe we should change the other drivers to match Darwin, @filcab pointed out the last attempt at doing that was in https://reviews.llvm.org/rL218541, and it was later reverted (https://reviews.llvm.org/rL220455) because we rely on that behavior in libcxx. The path of least resistance to consistency is to make Darwin behave like GNUTools and FreeBSD.


https://reviews.llvm.org/D24048





More information about the cfe-commits mailing list