| author | bors <bors@rust-lang.org> 2025-09-04 22:51:33 UTC |
| committer | bors <bors@rust-lang.org> 2025-09-04 22:51:33 UTC |
| log | b3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7 |
| tree | 6e291656e0d53f147359ddf2dd2a8a1e802cbdb7 |
| parent | af00ff2ce62b6617ed19305ae39e135ac71d0b22 |
| parent | 6d637dfeccd7d22523e584203e666535db878165 |
Sanitizers target modificators
Depends on bool flag fix: https://github.com/rust-lang/rust/pull/138483.
Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer
For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier.
Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.86 files changed, 311 insertions(+), 68 deletions(-)
compiler/rustc_metadata/src/creader.rs+13-5| ... | ... | @@ -412,7 +412,7 @@ impl CStore { |
| 412 | 412 | match (&left_name_val, &right_name_val) { |
| 413 | 413 | (Some(l), Some(r)) => match l.1.opt.cmp(&r.1.opt) { |
| 414 | 414 | cmp::Ordering::Equal => { |
| 415 | if l.0.tech_value != r.0.tech_value { | |
| 415 | if !l.1.consistent(&tcx.sess.opts, Some(&r.1)) { | |
| 416 | 416 | report_diff( |
| 417 | 417 | &l.0.prefix, |
| 418 | 418 | &l.0.name, |
| ... | ... | @@ -424,20 +424,28 @@ impl CStore { |
| 424 | 424 | right_name_val = None; |
| 425 | 425 | } |
| 426 | 426 | cmp::Ordering::Greater => { |
| 427 | report_diff(&r.0.prefix, &r.0.name, None, Some(&r.1.value_name)); | |
| 427 | if !r.1.consistent(&tcx.sess.opts, None) { | |
| 428 | report_diff(&r.0.prefix, &r.0.name, None, Some(&r.1.value_name)); | |
| 429 | } | |
| 428 | 430 | right_name_val = None; |
| 429 | 431 | } |
| 430 | 432 | cmp::Ordering::Less => { |
| 431 | report_diff(&l.0.prefix, &l.0.name, Some(&l.1.value_name), None); | |
| 433 | if !l.1.consistent(&tcx.sess.opts, None) { | |
| 434 | report_diff(&l.0.prefix, &l.0.name, Some(&l.1.value_name), None); | |
| 435 | } | |
| 432 | 436 | left_name_val = None; |
| 433 | 437 | } |
| 434 | 438 | }, |
| 435 | 439 | (Some(l), None) => { |
| 436 | report_diff(&l.0.prefix, &l.0.name, Some(&l.1.value_name), None); | |
| 440 | if !l.1.consistent(&tcx.sess.opts, None) { | |
| 441 | report_diff(&l.0.prefix, &l.0.name, Some(&l.1.value_name), None); | |
| 442 | } | |
| 437 | 443 | left_name_val = None; |
| 438 | 444 | } |
| 439 | 445 | (None, Some(r)) => { |
| 440 | report_diff(&r.0.prefix, &r.0.name, None, Some(&r.1.value_name)); | |
| 446 | if !r.1.consistent(&tcx.sess.opts, None) { | |
| 447 | report_diff(&r.0.prefix, &r.0.name, None, Some(&r.1.value_name)); | |
| 448 | } | |
| 441 | 449 | right_name_val = None; |
| 442 | 450 | } |
| 443 | 451 | (None, None) => break, |
compiler/rustc_session/src/options.rs+69-2| ... | ... | @@ -83,10 +83,77 @@ pub struct TargetModifier { |
| 83 | 83 | pub value_name: String, |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | mod target_modifier_consistency_check { | |
| 87 | use super::*; | |
| 88 | pub(super) fn sanitizer(l: &TargetModifier, r: Option<&TargetModifier>) -> bool { | |
| 89 | let mut lparsed: SanitizerSet = Default::default(); | |
| 90 | let lval = if l.value_name.is_empty() { None } else { Some(l.value_name.as_str()) }; | |
| 91 | parse::parse_sanitizers(&mut lparsed, lval); | |
| 92 | ||
| 93 | let mut rparsed: SanitizerSet = Default::default(); | |
| 94 | let rval = r.filter(|v| !v.value_name.is_empty()).map(|v| v.value_name.as_str()); | |
| 95 | parse::parse_sanitizers(&mut rparsed, rval); | |
| 96 | ||
| 97 | // Some sanitizers need to be target modifiers, and some do not. | |
| 98 | // For now, we should mark all sanitizers as target modifiers except for these: | |
| 99 | // AddressSanitizer, LeakSanitizer | |
| 100 | let tmod_sanitizers = SanitizerSet::MEMORY | |
| 101 | | SanitizerSet::THREAD | |
| 102 | | SanitizerSet::HWADDRESS | |
| 103 | | SanitizerSet::CFI | |
| 104 | | SanitizerSet::MEMTAG | |
| 105 | | SanitizerSet::SHADOWCALLSTACK | |
| 106 | | SanitizerSet::KCFI | |
| 107 | | SanitizerSet::KERNELADDRESS | |
| 108 | | SanitizerSet::SAFESTACK | |
| 109 | | SanitizerSet::DATAFLOW; | |
| 110 | ||
| 111 | lparsed & tmod_sanitizers == rparsed & tmod_sanitizers | |
| 112 | } | |
| 113 | pub(super) fn sanitizer_cfi_normalize_integers( | |
| 114 | opts: &Options, | |
| 115 | l: &TargetModifier, | |
| 116 | r: Option<&TargetModifier>, | |
| 117 | ) -> bool { | |
| 118 | // For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier | |
| 119 | if opts.unstable_opts.sanitizer.contains(SanitizerSet::KCFI) { | |
| 120 | if let Some(r) = r { | |
| 121 | return l.extend().tech_value == r.extend().tech_value; | |
| 122 | } else { | |
| 123 | return false; | |
| 124 | } | |
| 125 | } | |
| 126 | true | |
| 127 | } | |
| 128 | } | |
| 129 | ||
| 86 | 130 | impl TargetModifier { |
| 87 | 131 | pub fn extend(&self) -> ExtendedTargetModifierInfo { |
| 88 | 132 | self.opt.reparse(&self.value_name) |
| 89 | 133 | } |
| 134 | // Custom consistency check for target modifiers (or default `l.tech_value == r.tech_value`) | |
| 135 | // When other is None, consistency with default value is checked | |
| 136 | pub fn consistent(&self, opts: &Options, other: Option<&TargetModifier>) -> bool { | |
| 137 | assert!(other.is_none() || self.opt == other.unwrap().opt); | |
| 138 | match self.opt { | |
| 139 | OptionsTargetModifiers::UnstableOptions(unstable) => match unstable { | |
| 140 | UnstableOptionsTargetModifiers::sanitizer => { | |
| 141 | return target_modifier_consistency_check::sanitizer(self, other); | |
| 142 | } | |
| 143 | UnstableOptionsTargetModifiers::sanitizer_cfi_normalize_integers => { | |
| 144 | return target_modifier_consistency_check::sanitizer_cfi_normalize_integers( | |
| 145 | opts, self, other, | |
| 146 | ); | |
| 147 | } | |
| 148 | _ => {} | |
| 149 | }, | |
| 150 | _ => {} | |
| 151 | }; | |
| 152 | match other { | |
| 153 | Some(other) => self.extend().tech_value == other.extend().tech_value, | |
| 154 | None => false, | |
| 155 | } | |
| 156 | } | |
| 90 | 157 | } |
| 91 | 158 | |
| 92 | 159 | fn tmod_push_impl( |
| ... | ... | @@ -2504,13 +2571,13 @@ written to standard error output)"), |
| 2504 | 2571 | retpoline_external_thunk: bool = (false, parse_bool, [TRACKED TARGET_MODIFIER], |
| 2505 | 2572 | "enables retpoline-external-thunk, retpoline-indirect-branches and retpoline-indirect-calls \ |
| 2506 | 2573 | target features (default: no)"), |
| 2507 | sanitizer: SanitizerSet = (SanitizerSet::empty(), parse_sanitizers, [TRACKED], | |
| 2574 | sanitizer: SanitizerSet = (SanitizerSet::empty(), parse_sanitizers, [TRACKED TARGET_MODIFIER], | |
| 2508 | 2575 | "use a sanitizer"), |
| 2509 | 2576 | sanitizer_cfi_canonical_jump_tables: Option<bool> = (Some(true), parse_opt_bool, [TRACKED], |
| 2510 | 2577 | "enable canonical jump tables (default: yes)"), |
| 2511 | 2578 | sanitizer_cfi_generalize_pointers: Option<bool> = (None, parse_opt_bool, [TRACKED], |
| 2512 | 2579 | "enable generalizing pointer types (default: no)"), |
| 2513 | sanitizer_cfi_normalize_integers: Option<bool> = (None, parse_opt_bool, [TRACKED], | |
| 2580 | sanitizer_cfi_normalize_integers: Option<bool> = (None, parse_opt_bool, [TRACKED TARGET_MODIFIER], | |
| 2514 | 2581 | "enable normalizing integer types (default: no)"), |
| 2515 | 2582 | sanitizer_dataflow_abilist: Vec<String> = (Vec::new(), parse_comma_list, [TRACKED], |
| 2516 | 2583 | "additional ABI list files that control how shadow parameters are passed (comma separated)"), |
tests/codegen-llvm/sanitizer/address-sanitizer-globals-tracking.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | //@ only-linux |
| 20 | 20 | // |
| 21 | 21 | //@ revisions:ASAN ASAN-FAT-LTO |
| 22 | //@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static | |
| 22 | //@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 23 | 23 | // [ASAN] no extra compile-flags |
| 24 | 24 | //@[ASAN-FAT-LTO] compile-flags: -Cprefer-dynamic=false -Clto=fat |
| 25 | 25 |
tests/codegen-llvm/sanitizer/cfi/add-canonical-jump-tables-flag.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that "CFI Canonical Jump Tables" module flag is added. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 4 | //@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/add-cfi-normalize-integers-flag.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that "cfi-normalize-integers" module flag is added. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers | |
| 4 | //@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/add-enable-split-lto-unit-flag.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that "EnableSplitLTOUnit" module flag is added. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 4 | //@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/dbg-location-on-cfi-blocks.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that the parent block's debug information are assigned to the inserted cfi block. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -Cdebuginfo=1 | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -Cdebuginfo=1 -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/emit-type-checks-attr-sanitize-off.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that pointer type membership tests for indirect calls are omitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 | #![feature(sanitize)] |
tests/codegen-llvm/sanitizer/cfi/emit-type-checks.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that pointer type membership tests for indirect calls are emitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that user-defined CFI encoding for types are emitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 | #![feature(cfi_encoding, extern_types)] |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for const generics. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 | #![feature(type_alias_impl_trait)] |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | // future. |
| 6 | 6 | // |
| 7 | 7 | //@ needs-sanitizer-cfi |
| 8 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 8 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 9 | 9 | |
| 10 | 10 | #![crate_type = "lib"] |
| 11 | 11 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for function types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for lifetimes/regions. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 | #![feature(type_alias_impl_trait)] |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // self so they can be used as function pointers. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for paths. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 | #![feature(type_alias_impl_trait)] |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for pointer types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for primitive types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for repr transparent types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for sequence types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for trait types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // for user-defined types. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 | #![feature(extern_types)] |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that generalized type metadata for functions are emitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that normalized and generalized type metadata for functions are emitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -Zsanitizer-cfi-generalize-pointers | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -Zsanitizer-cfi-generalize-pointers -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that normalized type metadata for functions are emitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that type metadata for functions are emitted. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/emit-type-metadata-trait-objects.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that type metadata identifiers for trait objects are emitted correctly. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/external_weak_symbols.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // emitted correctly. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Clinker-plugin-lto -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Clinker-plugin-lto -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | #![crate_type = "bin"] |
| 7 | 7 | #![feature(linkage)] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/cfi/generalize-pointers.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that pointer types are generalized. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers -Copt-level=0 | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/cfi/normalize-integers.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that integer types are normalized. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-cfi |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -Copt-level=0 | |
| 4 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/dataflow-instrument-functions.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Verifies that functions are instrumented. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-dataflow |
| 4 | //@ compile-flags: -Copt-level=0 -Zsanitizer=dataflow | |
| 4 | //@ compile-flags: -Copt-level=0 -Zsanitizer=dataflow -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/memory-track-origins.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | //@ needs-sanitizer-memory |
| 5 | 5 | //@ revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO |
| 6 | 6 | // |
| 7 | //@ compile-flags: -Zsanitizer=memory -Ctarget-feature=-crt-static | |
| 7 | //@ compile-flags: -Zsanitizer=memory -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 8 | 8 | // [MSAN-0] no extra compile-flags |
| 9 | 9 | //@[MSAN-1] compile-flags: -Zsanitizer-memory-track-origins=1 |
| 10 | 10 | //@[MSAN-2] compile-flags: -Zsanitizer-memory-track-origins |
tests/codegen-llvm/sanitizer/memtag-attr-check.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // applied when enabling the memtag sanitizer. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-memtag |
| 5 | //@ compile-flags: -Zsanitizer=memtag -Ctarget-feature=+mte -Copt-level=0 | |
| 5 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer -Zsanitizer=memtag -Ctarget-feature=+mte -Copt-level=0 | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 |
tests/codegen-llvm/sanitizer/safestack-attr-check.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // This tests that the safestack attribute is applied when enabling the safe-stack sanitizer. |
| 2 | 2 | // |
| 3 | 3 | //@ needs-sanitizer-safestack |
| 4 | //@ compile-flags: -Zsanitizer=safestack -Copt-level=0 | |
| 4 | //@ compile-flags: -Zsanitizer=safestack -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | |
| 6 | 6 | #![crate_type = "lib"] |
| 7 | 7 |
tests/codegen-llvm/sanitizer/sanitize-off-inlining.rs+1-1| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | // Verifies that sanitize(xyz = "off") attribute prevents inlining when |
| 2 | 2 | // given sanitizer is enabled, but has no effect on inlining otherwise. |
| 3 | // | |
| 4 | 3 | //@ needs-sanitizer-address |
| 5 | 4 | //@ needs-sanitizer-leak |
| 6 | 5 | //@ revisions: ASAN LSAN |
| 6 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 7 | 7 | //@ compile-flags: -Copt-level=3 -Zmir-opt-level=4 -Ctarget-feature=-crt-static |
| 8 | 8 | //@[ASAN] compile-flags: -Zsanitizer=address |
| 9 | 9 | //@[LSAN] compile-flags: -Zsanitizer=leak |
tests/codegen-llvm/sanitizer/sanitize-off-kasan-asan.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // the address sanitizer. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-address |
| 5 | //@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static -Copt-level=0 | |
| 5 | //@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static -Copt-level=0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | |
| 7 | 7 | #![crate_type = "lib"] |
| 8 | 8 | #![feature(sanitize)] |
tests/codegen-llvm/sanitizer/sanitizer-recover.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | //@ needs-sanitizer-memory |
| 6 | 6 | //@ revisions:ASAN ASAN-RECOVER MSAN MSAN-RECOVER MSAN-RECOVER-LTO |
| 7 | 7 | //@ no-prefer-dynamic |
| 8 | // | |
| 8 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 9 | 9 | //@ compile-flags: -Ctarget-feature=-crt-static |
| 10 | 10 | //@[ASAN] compile-flags: -Zsanitizer=address -Copt-level=0 |
| 11 | 11 | //@[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address -Copt-level=0 |
tests/run-make/sanitizer-cdylib-link/rmake.rs+2| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | //@ needs-sanitizer-support |
| 9 | 9 | //@ needs-sanitizer-address |
| 10 | 10 | |
| 11 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 12 | ||
| 11 | 13 | use run_make_support::{run_fail, rustc}; |
| 12 | 14 | |
| 13 | 15 | fn main() { |
tests/run-make/sanitizer-dylib-link/rmake.rs+2| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | //@ needs-sanitizer-support |
| 8 | 8 | //@ needs-sanitizer-address |
| 9 | 9 | |
| 10 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 11 | ||
| 10 | 12 | use run_make_support::{run_fail, rustc}; |
| 11 | 13 | |
| 12 | 14 | fn main() { |
tests/run-make/sanitizer-staticlib-link/rmake.rs+2| ... | ... | @@ -11,6 +11,8 @@ |
| 11 | 11 | //@ needs-sanitizer-support |
| 12 | 12 | //@ needs-sanitizer-address |
| 13 | 13 | |
| 14 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 15 | ||
| 14 | 16 | use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run_fail, rustc, static_lib_name}; |
| 15 | 17 | |
| 16 | 18 | fn main() { |
tests/rustdoc/sanitizer-option.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //@ needs-sanitizer-support |
| 2 | 2 | //@ needs-sanitizer-address |
| 3 | //@ compile-flags: --test -Z sanitizer=address | |
| 3 | //@ compile-flags: --test -Z sanitizer=address -C unsafe-allow-abi-mismatch=sanitizer | |
| 4 | 4 | // |
| 5 | 5 | // #43031: Verify that rustdoc passes `-Z` options to rustc. Use an extern |
| 6 | 6 | // function that is provided by the sanitizer runtime, if flag is not passed |
tests/ui/asm/global-asm-isnt-really-a-mir-body.rs+2| ... | ... | @@ -1,5 +1,7 @@ |
| 1 | 1 | //@ revisions: emit_mir instrument cfi |
| 2 | 2 | |
| 3 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 4 | ||
| 3 | 5 | // Make sure we don't try to emit MIR for it. |
| 4 | 6 | //@[emit_mir] compile-flags: --emit=mir |
| 5 | 7 |
tests/ui/lto/issue-100772.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //@ build-pass |
| 2 | 2 | //@ needs-sanitizer-cfi |
| 3 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 3 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 4 | 4 | //@ no-prefer-dynamic |
| 5 | 5 | //@ only-x86_64-unknown-linux-gnu |
| 6 | 6 |
tests/ui/sanitizer/address.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //@ needs-sanitizer-address |
| 3 | 3 | //@ ignore-cross-compile |
| 4 | 4 | // |
| 5 | //@ compile-flags: -Z sanitizer=address -O -g | |
| 5 | //@ compile-flags: -Z sanitizer=address -O -g -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | // |
| 7 | 7 | //@ run-fail-or-crash |
| 8 | 8 | //@ error-pattern: AddressSanitizer: stack-buffer-overflow |
tests/ui/sanitizer/asan_odr_windows.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //! See <https://github.com/rust-lang/rust/issues/124390>. |
| 3 | 3 | |
| 4 | 4 | //@ run-pass |
| 5 | //@ compile-flags:-Zsanitizer=address | |
| 5 | //@ compile-flags:-Zsanitizer=address -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | //@ aux-build: asan_odr_win-2.rs |
| 7 | 7 | //@ only-windows-msvc |
| 8 | 8 | //@ needs-sanitizer-support |
tests/ui/sanitizer/badfree.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //@ needs-sanitizer-address |
| 3 | 3 | //@ ignore-cross-compile |
| 4 | 4 | // |
| 5 | //@ compile-flags: -Z sanitizer=address -O | |
| 5 | //@ compile-flags: -Z sanitizer=address -O -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | // |
| 7 | 7 | //@ run-fail-or-crash |
| 8 | 8 | //@ regex-error-pattern: AddressSanitizer: (SEGV|attempting free on address which was not malloc) |
tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // trait object type to fail, causing an ICE. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 5 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | //@ edition: 2021 |
| 7 | 7 | //@ no-prefer-dynamic |
| 8 | 8 | //@ only-x86_64-unknown-linux-gnu |
tests/ui/sanitizer/cfi/async-closures.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | //@ ignore-backends: gcc |
| 8 | 8 | //@ [cfi] needs-sanitizer-cfi |
| 9 | 9 | //@ [kcfi] needs-sanitizer-kcfi |
| 10 | //@ compile-flags: -C target-feature=-crt-static | |
| 10 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 11 | 11 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 12 | 12 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 13 | 13 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/can-reveal-opaques.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | //@ needs-sanitizer-cfi |
| 2 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 2 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 3 | 3 | //@ no-prefer-dynamic |
| 4 | 4 | //@ only-x86_64-unknown-linux-gnu |
| 5 | 5 | //@ ignore-backends: gcc |
tests/ui/sanitizer/cfi/closures.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | //@ ignore-backends: gcc |
| 7 | 7 | //@ [cfi] needs-sanitizer-cfi |
| 8 | 8 | //@ [kcfi] needs-sanitizer-kcfi |
| 9 | //@ compile-flags: -C target-feature=-crt-static | |
| 9 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 10 | 10 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 11 | 11 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 12 | 12 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/complex-receiver.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | //@ ignore-backends: gcc |
| 9 | 9 | //@ [cfi] needs-sanitizer-cfi |
| 10 | 10 | //@ [kcfi] needs-sanitizer-kcfi |
| 11 | //@ compile-flags: -C target-feature=-crt-static | |
| 11 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 12 | 12 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 13 | 13 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 14 | 14 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/coroutine.rs+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | //@ [cfi] needs-sanitizer-cfi |
| 9 | 9 | //@ [kcfi] needs-sanitizer-kcfi |
| 10 | 10 | //@ compile-flags: -C target-feature=-crt-static |
| 11 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 11 | 12 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 12 | 13 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 13 | 14 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/drop-in-place.rs+1| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | //@ ignore-backends: gcc |
| 6 | 6 | //@ needs-sanitizer-cfi |
| 7 | 7 | //@ compile-flags: -Clto -Copt-level=0 -Cprefer-dynamic=off -Ctarget-feature=-crt-static -Zsanitizer=cfi |
| 8 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 8 | 9 | //@ run-pass |
| 9 | 10 | |
| 10 | 11 | struct EmptyDrop; |
tests/ui/sanitizer/cfi/drop-no-principal.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | // FIXME(#122848) Remove only-linux once OSX CFI binaries works |
| 5 | 5 | //@ only-linux |
| 6 | 6 | //@ ignore-backends: gcc |
| 7 | //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi | |
| 7 | //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 8 | 8 | //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0 |
| 9 | 9 | // FIXME(#118761) Should be run-pass once the labels on drop are compatible. |
| 10 | 10 | // This test is being landed ahead of that to test that the compiler doesn't ICE while labeling the |
tests/ui/sanitizer/cfi/fn-ptr.rs+1| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | //@ [cfi] needs-sanitizer-cfi |
| 8 | 8 | //@ [kcfi] needs-sanitizer-kcfi |
| 9 | 9 | //@ compile-flags: -C target-feature=-crt-static |
| 10 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 10 | 11 | //@ [cfi] compile-flags: -C opt-level=0 -C codegen-units=1 -C lto |
| 11 | 12 | //@ [cfi] compile-flags: -C prefer-dynamic=off |
| 12 | 13 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
tests/ui/sanitizer/cfi/generalize-pointers-attr-cfg.rs+1| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | 5 | //@ check-pass |
| 6 | 6 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers |
| 7 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 7 | 8 | |
| 8 | 9 | #![feature(cfg_sanitizer_cfi)] |
| 9 | 10 |
tests/ui/sanitizer/cfi/normalize-integers-attr-cfg.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | 5 | //@ check-pass |
| 6 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers | |
| 6 | //@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers | |
| 7 | 7 | |
| 8 | 8 | #![feature(cfg_sanitizer_cfi)] |
| 9 | 9 |
tests/ui/sanitizer/cfi/self-ref.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | //@ ignore-backends: gcc |
| 7 | 7 | //@ [cfi] needs-sanitizer-cfi |
| 8 | 8 | //@ [kcfi] needs-sanitizer-kcfi |
| 9 | //@ compile-flags: -C target-feature=-crt-static | |
| 9 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 10 | 10 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 11 | 11 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 12 | 12 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/sized-associated-ty.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | //@ ignore-backends: gcc |
| 8 | 8 | //@ [cfi] needs-sanitizer-cfi |
| 9 | 9 | //@ [kcfi] needs-sanitizer-kcfi |
| 10 | //@ compile-flags: -C target-feature=-crt-static | |
| 10 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 11 | 11 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 12 | 12 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 13 | 13 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/supertraits.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | //@ ignore-backends: gcc |
| 7 | 7 | //@ [cfi] needs-sanitizer-cfi |
| 8 | 8 | //@ [kcfi] needs-sanitizer-kcfi |
| 9 | //@ compile-flags: -C target-feature=-crt-static | |
| 9 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 10 | 10 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 11 | 11 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 12 | 12 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/cfi/transparent-has-regions.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | //@ needs-sanitizer-cfi |
| 2 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 2 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 3 | 3 | //@ no-prefer-dynamic |
| 4 | 4 | //@ only-x86_64-unknown-linux-gnu |
| 5 | 5 | //@ build-pass |
tests/ui/sanitizer/cfi/virtual-auto.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | //@ ignore-backends: gcc |
| 7 | 7 | //@ [cfi] needs-sanitizer-cfi |
| 8 | 8 | //@ [kcfi] needs-sanitizer-kcfi |
| 9 | //@ compile-flags: -C target-feature=-crt-static | |
| 9 | //@ compile-flags: -C target-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 10 | 10 | //@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0 |
| 11 | 11 | //@ [cfi] compile-flags: -Z sanitizer=cfi |
| 12 | 12 | //@ [kcfi] compile-flags: -Z sanitizer=kcfi |
tests/ui/sanitizer/dataflow.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | //@ needs-sanitizer-support |
| 5 | 5 | //@ needs-sanitizer-dataflow |
| 6 | 6 | //@ run-pass |
| 7 | //@ compile-flags: -Zsanitizer=dataflow -Zsanitizer-dataflow-abilist={{src-base}}/sanitizer/dataflow-abilist.txt | |
| 7 | //@ compile-flags: -Zsanitizer=dataflow -Zsanitizer-dataflow-abilist={{src-base}}/sanitizer/dataflow-abilist.txt -C unsafe-allow-abi-mismatch=sanitizer | |
| 8 | 8 | |
| 9 | 9 | use std::mem::size_of; |
| 10 | 10 | use std::os::raw::{c_int, c_long, c_void}; |
tests/ui/sanitizer/hwaddress.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | //@ ignore-aarch64-unknown-linux-gnu |
| 6 | 6 | // |
| 7 | 7 | // FIXME(#83989): codegen-units=1 triggers linker errors on aarch64-gnu |
| 8 | //@ compile-flags: -Z sanitizer=hwaddress -O -g -C codegen-units=16 | |
| 8 | //@ compile-flags: -Z sanitizer=hwaddress -O -g -C codegen-units=16 -C unsafe-allow-abi-mismatch=sanitizer | |
| 9 | 9 | // |
| 10 | 10 | //@ run-fail |
| 11 | 11 | //@ error-pattern: HWAddressSanitizer: tag-mismatch |
tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // encode_ty and caused the compiler to ICE. |
| 3 | 3 | // |
| 4 | 4 | //@ needs-sanitizer-cfi |
| 5 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi | |
| 5 | //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | //@ edition: 2021 |
| 7 | 7 | //@ no-prefer-dynamic |
| 8 | 8 | //@ only-x86_64-unknown-linux-gnu |
tests/ui/sanitizer/issue-114275-cfi-const-expr-in-arry-len.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // was expecting array type lengths to be evaluated, this was causing an ICE. |
| 3 | 3 | // |
| 4 | 4 | //@ build-pass |
| 5 | //@ compile-flags: -Ccodegen-units=1 -Clto -Zsanitizer=cfi -Ctarget-feature=-crt-static | |
| 5 | //@ compile-flags: -Ccodegen-units=1 -Clto -Zsanitizer=cfi -Ctarget-feature=-crt-static -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | //@ needs-sanitizer-cfi |
| 7 | 7 | |
| 8 | 8 | #![crate_type = "lib"] |
tests/ui/sanitizer/issue-72154-address-lifetime-markers.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | //@ needs-sanitizer-address |
| 8 | 8 | //@ ignore-cross-compile |
| 9 | 9 | // |
| 10 | //@ compile-flags: -Copt-level=0 -Zsanitizer=address | |
| 10 | //@ compile-flags: -Copt-level=0 -Zsanitizer=address -C unsafe-allow-abi-mismatch=sanitizer | |
| 11 | 11 | //@ run-pass |
| 12 | 12 | |
| 13 | 13 | pub struct Wrap { |
tests/ui/sanitizer/kcfi-mangling.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | //@ needs-sanitizer-kcfi |
| 4 | 4 | //@ no-prefer-dynamic |
| 5 | //@ compile-flags: -C panic=abort -Zsanitizer=kcfi -C symbol-mangling-version=v0 | |
| 5 | //@ compile-flags: -C panic=abort -Zsanitizer=kcfi -C symbol-mangling-version=v0 -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | //@ build-pass |
| 7 | 7 | //@ ignore-backends: gcc |
| 8 | 8 |
tests/ui/sanitizer/leak.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //@ needs-sanitizer-support |
| 2 | 2 | //@ needs-sanitizer-leak |
| 3 | 3 | // |
| 4 | //@ compile-flags: -Z sanitizer=leak -O | |
| 4 | //@ compile-flags: -Z sanitizer=leak -O -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | 5 | // |
| 6 | 6 | //@ run-fail |
| 7 | 7 | //@ error-pattern: LeakSanitizer: detected memory leaks |
tests/ui/sanitizer/memory-eager.rs+2| ... | ... | @@ -1,6 +1,8 @@ |
| 1 | 1 | //@ needs-sanitizer-support |
| 2 | 2 | //@ needs-sanitizer-memory |
| 3 | 3 | // |
| 4 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | // | |
| 4 | 6 | //@ revisions: unoptimized optimized |
| 5 | 7 | // |
| 6 | 8 | //@ [optimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O |
tests/ui/sanitizer/memory-passing.rs+2| ... | ... | @@ -1,6 +1,8 @@ |
| 1 | 1 | //@ needs-sanitizer-support |
| 2 | 2 | //@ needs-sanitizer-memory |
| 3 | 3 | // |
| 4 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | // | |
| 4 | 6 | //@ revisions: unoptimized optimized |
| 5 | 7 | // |
| 6 | 8 | //@ [optimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O |
tests/ui/sanitizer/memory.rs+2| ... | ... | @@ -1,6 +1,8 @@ |
| 1 | 1 | //@ needs-sanitizer-support |
| 2 | 2 | //@ needs-sanitizer-memory |
| 3 | 3 | // |
| 4 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 5 | // | |
| 4 | 6 | //@ revisions: unoptimized optimized |
| 5 | 7 | // |
| 6 | 8 | //@ [optimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O |
tests/ui/sanitizer/new-llvm-pass-manager-thin-lto.rs+2| ... | ... | @@ -6,6 +6,8 @@ |
| 6 | 6 | //@ needs-sanitizer-address |
| 7 | 7 | //@ ignore-cross-compile |
| 8 | 8 | // |
| 9 | //@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer | |
| 10 | // | |
| 9 | 11 | //@ no-prefer-dynamic |
| 10 | 12 | //@ revisions: opt0 opt1 |
| 11 | 13 | //@ compile-flags: -Zsanitizer=address -Clto=thin |
tests/ui/sanitizer/thread.rs+1-1| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | //@ needs-sanitizer-support |
| 14 | 14 | //@ needs-sanitizer-thread |
| 15 | 15 | // |
| 16 | //@ compile-flags: -Z sanitizer=thread -O | |
| 16 | //@ compile-flags: -Z sanitizer=thread -O -C unsafe-allow-abi-mismatch=sanitizer | |
| 17 | 17 | // |
| 18 | 18 | //@ run-fail-or-crash |
| 19 | 19 | //@ error-pattern: WARNING: ThreadSanitizer: data race |
tests/ui/sanitizer/use-after-scope.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //@ needs-sanitizer-address |
| 3 | 3 | //@ ignore-cross-compile |
| 4 | 4 | // |
| 5 | //@ compile-flags: -Zsanitizer=address | |
| 5 | //@ compile-flags: -Zsanitizer=address -C unsafe-allow-abi-mismatch=sanitizer | |
| 6 | 6 | //@ run-fail-or-crash |
| 7 | 7 | //@ error-pattern: ERROR: AddressSanitizer: stack-use-after-scope |
| 8 | 8 |
tests/ui/target_modifiers/auxiliary/kcfi-normalize-ints.rs created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | //@ no-prefer-dynamic | |
| 2 | //@ needs-sanitizer-kcfi | |
| 3 | //@ compile-flags: -C panic=abort -Zsanitizer=kcfi -Zsanitizer-cfi-normalize-integers | |
| 4 | ||
| 5 | #![feature(no_core)] | |
| 6 | #![crate_type = "rlib"] | |
| 7 | #![no_core] |
tests/ui/target_modifiers/auxiliary/no-sanitizers.rs created+6| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | //@ no-prefer-dynamic | |
| 2 | //@ compile-flags: -C panic=abort | |
| 3 | ||
| 4 | #![feature(no_core)] | |
| 5 | #![crate_type = "rlib"] | |
| 6 | #![no_core] |
tests/ui/target_modifiers/auxiliary/safestack-and-kcfi.rs created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | //@ no-prefer-dynamic | |
| 2 | ||
| 3 | //@ needs-sanitizer-kcfi | |
| 4 | //@ needs-sanitizer-safestack | |
| 5 | ||
| 6 | //@ compile-flags: -C panic=abort -Zsanitizer=safestack,kcfi | |
| 7 | ||
| 8 | #![feature(no_core)] | |
| 9 | #![crate_type = "rlib"] | |
| 10 | #![no_core] |
tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.rs created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | // For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. | |
| 2 | ||
| 3 | //@ needs-sanitizer-kcfi | |
| 4 | //@ aux-build:kcfi-normalize-ints.rs | |
| 5 | //@ compile-flags: -Cpanic=abort | |
| 6 | ||
| 7 | //@ revisions: ok wrong_flag wrong_sanitizer | |
| 8 | //@[ok] compile-flags: -Zsanitizer=kcfi -Zsanitizer-cfi-normalize-integers | |
| 9 | //@[wrong_flag] compile-flags: -Zsanitizer=kcfi | |
| 10 | //@[ok] check-pass | |
| 11 | ||
| 12 | #![feature(no_core)] | |
| 13 | //[wrong_flag]~^ ERROR mixing `-Zsanitizer-cfi-normalize-integers` will cause an ABI mismatch in crate `sanitizer_kcfi_normalize_ints` | |
| 14 | //[wrong_sanitizer]~^^ ERROR mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizer_kcfi_normalize_ints` | |
| 15 | #![crate_type = "rlib"] | |
| 16 | #![no_core] | |
| 17 | ||
| 18 | extern crate kcfi_normalize_ints; |
tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.wrong_flag.stderr created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | error: mixing `-Zsanitizer-cfi-normalize-integers` will cause an ABI mismatch in crate `sanitizer_kcfi_normalize_ints` | |
| 2 | --> $DIR/sanitizer-kcfi-normalize-ints.rs:12:1 | |
| 3 | | | |
| 4 | LL | #![feature(no_core)] | |
| 5 | | ^ | |
| 6 | | | |
| 7 | = help: the `-Zsanitizer-cfi-normalize-integers` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely | |
| 8 | = note: unset `-Zsanitizer-cfi-normalize-integers` in this crate is incompatible with `-Zsanitizer-cfi-normalize-integers=` in dependency `kcfi_normalize_ints` | |
| 9 | = help: set `-Zsanitizer-cfi-normalize-integers=` in this crate or unset `-Zsanitizer-cfi-normalize-integers` in `kcfi_normalize_ints` | |
| 10 | = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer-cfi-normalize-integers` to silence this error | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 |
tests/ui/target_modifiers/sanitizer-kcfi-normalize-ints.wrong_sanitizer.stderr created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizer_kcfi_normalize_ints` | |
| 2 | --> $DIR/sanitizer-kcfi-normalize-ints.rs:12:1 | |
| 3 | | | |
| 4 | LL | #![feature(no_core)] | |
| 5 | | ^ | |
| 6 | | | |
| 7 | = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely | |
| 8 | = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=kcfi` in dependency `kcfi_normalize_ints` | |
| 9 | = help: set `-Zsanitizer=kcfi` in this crate or unset `-Zsanitizer` in `kcfi_normalize_ints` | |
| 10 | = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 |
tests/ui/target_modifiers/sanitizers-good-for-inconsistency.rs created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | // AddressSanitizer, LeakSanitizer are good to be inconsistent (they are not a target modifiers) | |
| 2 | ||
| 3 | //@ revisions: wrong_address_san wrong_leak_san | |
| 4 | ||
| 5 | //@[wrong_address_san] needs-sanitizer-address | |
| 6 | //@[wrong_leak_san] needs-sanitizer-leak | |
| 7 | ||
| 8 | //@ aux-build:no-sanitizers.rs | |
| 9 | //@ compile-flags: -Cpanic=abort -C target-feature=-crt-static | |
| 10 | ||
| 11 | //@[wrong_address_san] compile-flags: -Zsanitizer=address | |
| 12 | //@[wrong_leak_san] compile-flags: -Zsanitizer=leak | |
| 13 | //@ check-pass | |
| 14 | ||
| 15 | #![feature(no_core)] | |
| 16 | #![crate_type = "rlib"] | |
| 17 | #![no_core] | |
| 18 | ||
| 19 | extern crate no_sanitizers; |
tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.missed_both.stderr created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizers_safestack_and_kcfi` | |
| 2 | --> $DIR/sanitizers-safestack-and-kcfi.rs:16:1 | |
| 3 | | | |
| 4 | LL | #![feature(no_core)] | |
| 5 | | ^ | |
| 6 | | | |
| 7 | = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely | |
| 8 | = note: unset `-Zsanitizer` in this crate is incompatible with `-Zsanitizer=safestack,kcfi` in dependency `safestack_and_kcfi` | |
| 9 | = help: set `-Zsanitizer=safestack,kcfi` in this crate or unset `-Zsanitizer` in `safestack_and_kcfi` | |
| 10 | = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 |
tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.missed_kcfi.stderr created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizers_safestack_and_kcfi` | |
| 2 | --> $DIR/sanitizers-safestack-and-kcfi.rs:16:1 | |
| 3 | | | |
| 4 | LL | #![feature(no_core)] | |
| 5 | | ^ | |
| 6 | | | |
| 7 | = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely | |
| 8 | = note: `-Zsanitizer=safestack` in this crate is incompatible with `-Zsanitizer=safestack,kcfi` in dependency `safestack_and_kcfi` | |
| 9 | = help: set `-Zsanitizer=safestack,kcfi` in this crate or `-Zsanitizer=safestack` in `safestack_and_kcfi` | |
| 10 | = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 |
tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.missed_safestack.stderr created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | error: mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizers_safestack_and_kcfi` | |
| 2 | --> $DIR/sanitizers-safestack-and-kcfi.rs:16:1 | |
| 3 | | | |
| 4 | LL | #![feature(no_core)] | |
| 5 | | ^ | |
| 6 | | | |
| 7 | = help: the `-Zsanitizer` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely | |
| 8 | = note: `-Zsanitizer=kcfi` in this crate is incompatible with `-Zsanitizer=safestack,kcfi` in dependency `safestack_and_kcfi` | |
| 9 | = help: set `-Zsanitizer=safestack,kcfi` in this crate or `-Zsanitizer=kcfi` in `safestack_and_kcfi` | |
| 10 | = help: if you are sure this will not cause problems, you may use `-Cunsafe-allow-abi-mismatch=sanitizer` to silence this error | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 |
tests/ui/target_modifiers/sanitizers-safestack-and-kcfi.rs created+23| ... | ... | @@ -0,0 +1,23 @@ |
| 1 | //@ needs-sanitizer-kcfi | |
| 2 | //@ needs-sanitizer-safestack | |
| 3 | ||
| 4 | //@ aux-build:safestack-and-kcfi.rs | |
| 5 | //@ compile-flags: -Cpanic=abort | |
| 6 | ||
| 7 | //@ revisions: good good_reverted missed_safestack missed_kcfi missed_both | |
| 8 | //@[good] compile-flags: -Zsanitizer=safestack,kcfi | |
| 9 | //@[good_reverted] compile-flags: -Zsanitizer=kcfi,safestack | |
| 10 | //@[missed_safestack] compile-flags: -Zsanitizer=kcfi | |
| 11 | //@[missed_kcfi] compile-flags: -Zsanitizer=safestack | |
| 12 | // [missed_both] no additional compile-flags: | |
| 13 | //@[good] check-pass | |
| 14 | //@[good_reverted] check-pass | |
| 15 | ||
| 16 | #![feature(no_core)] | |
| 17 | //[missed_safestack]~^ ERROR mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizers_safestack_and_kcfi` | |
| 18 | //[missed_kcfi]~^^ ERROR mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizers_safestack_and_kcfi` | |
| 19 | //[missed_both]~^^^ ERROR mixing `-Zsanitizer` will cause an ABI mismatch in crate `sanitizers_safestack_and_kcfi` | |
| 20 | #![crate_type = "rlib"] | |
| 21 | #![no_core] | |
| 22 | ||
| 23 | extern crate safestack_and_kcfi; |