This is an archive of the discontinued LLVM Phabricator instance.

[Driver] Automatically disable incompatible default sanitizers
ClosedPublic

Authored by phosek on Mar 2 2018, 7:31 PM.

Details

Summary

When a sanitizer incompatible with one of the default sanitizers
is explicitly enabled, automatically disable all the conflicting
default sanitizers.

Diff Detail

Repository
rC Clang

Event Timeline

phosek created this revision.Mar 2 2018, 7:31 PM
vitalybuka added inline comments.Mar 5 2018, 4:18 PM
clang/lib/Driver/SanitizerArgs.cpp
369 ↗(On Diff #136893)

Is this change needed to avoid errors at "Kinds & NeedsLTO" and KindsToDiagnose?
Could you create a test for this change?

phosek added inline comments.Mar 5 2018, 4:29 PM
clang/lib/Driver/SanitizerArgs.cpp
369 ↗(On Diff #136893)

It is needed for D44065, if we enable some sanitizers like SafeStack by default, user would get an error when they enable some incompatible sanitizer like ASan and would require them passing -fno-sanitizer=safe-stack to avoid that error which is non-intuitive. Instead, with this change the incompatible default sanitizers are disabled automatically.

vitalybuka accepted this revision.Mar 5 2018, 5:00 PM
This revision is now accepted and ready to land.Mar 5 2018, 5:00 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.