<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 8, 2016 at 11:19 AM, Anna Zaks <span dir="ltr"><<a href="mailto:zaks.anna@gmail.com" target="_blank">zaks.anna@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">zaks.anna added a comment.<br>
<span class="gmail-"><br>
> I don't see the point of adding another flag to control this when we already have a perfectly good set of<br>
<br>
>  flags that already do the right thing -- that takes us three levels deep in flags overriding the behavior of<br>
<br>
>  other flags, and I don't see how it actually helps our users in any way.<br>
<br>
<br>
</span>Going with silently linking the sanitizer runtimes when -nostdlib is passed will cause regressions in user experience. They will start getting inexplicable run time failures instead of build failures. Which solution do you propose to fix this problem?</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
This specific situation comes up often on internal mailing lists, so we should not go for a solution that regresses the behavior on Darwin.</blockquote><div><br></div><div><div>Ultimately, the clang driver should do whatever makes sense for Darwin when targeting Darwin, and in this case perhaps being compatible with earlier versions of the driver is the right thing. However, if we reach consensus that the non-Darwin behavior is preferable, we do have reasonable options to transition. For instance, we could change the driver to produce a warning if -nodefaultlibs is enabled with a -fsanitize= flag, suggesting adding -fno-sanitize=all to avoid linking the sanitizer runtimes, and then after a release or two, change the behavior for that case to link the sanitizer runtimes. We've done similar things for other changes to sanitizer flags in the past and it's worked out pretty well. If we go that way, we could add a -f flag to force linking the sanitizer runtime even with -nodefaultlibs to tide libc++ over until the Darwin driver is brought in line with our other modes. Likewise, if we decide that the current Darwin behavior is preferable, we can transition the driver behavior for non-Darwin targets in an analogous way.</div></div></div></div></div>