Relax restrictions on multiple sanitizers
Most combinations of LLVM sanitizers are legal-enough to enable simultaneously. This change will allow simultaneously enabling ASAN and shadow call stacks on supported platforms.
This commit is contained in:
parent
982a58e900
commit
d7d3bd1221
2 changed files with 36 additions and 11 deletions
|
@ -1181,9 +1181,9 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
|
|||
});
|
||||
}
|
||||
}
|
||||
// Cannot mix and match sanitizers.
|
||||
let mut sanitizer_iter = sess.opts.unstable_opts.sanitizer.into_iter();
|
||||
if let (Some(first), Some(second)) = (sanitizer_iter.next(), sanitizer_iter.next()) {
|
||||
|
||||
// Cannot mix and match mutually-exclusive sanitizers.
|
||||
if let Some((first, second)) = sess.opts.unstable_opts.sanitizer.mutually_exclusive() {
|
||||
sess.dcx().emit_err(errors::CannotMixAndMatchSanitizers {
|
||||
first: first.to_string(),
|
||||
second: second.to_string(),
|
||||
|
@ -1218,14 +1218,6 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
|
|||
sess.dcx().emit_err(errors::SanitizerCfiRequiresSingleCodegenUnit);
|
||||
}
|
||||
|
||||
// LLVM CFI is incompatible with LLVM KCFI.
|
||||
if sess.is_sanitizer_cfi_enabled() && sess.is_sanitizer_kcfi_enabled() {
|
||||
sess.dcx().emit_err(errors::CannotMixAndMatchSanitizers {
|
||||
first: "cfi".to_string(),
|
||||
second: "kcfi".to_string(),
|
||||
});
|
||||
}
|
||||
|
||||
// Canonical jump tables requires CFI.
|
||||
if sess.is_sanitizer_cfi_canonical_jump_tables_disabled() {
|
||||
if !sess.is_sanitizer_cfi_enabled() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue