Skip to content

Commit 509e0b3

Browse files
committed
-Zsanitize and -Zsanitizer-cfi-normalize-integers are now target modifiers with custom consistency check function
1 parent a3bab7f commit 509e0b3

File tree

62 files changed

+184
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+184
-4
lines changed

Diff for: compiler/rustc_metadata/src/creader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl CStore {
416416
match (&left_name_val, &right_name_val) {
417417
(Some(l), Some(r)) => match l.1.opt.cmp(&r.1.opt) {
418418
cmp::Ordering::Equal => {
419-
if l.0.tech_value != r.0.tech_value {
419+
if !l.1.consistent(&tcx.sess.opts, &r.1) {
420420
report_diff(
421421
&l.0.prefix,
422422
&l.0.name,

Diff for: compiler/rustc_session/src/options.rs

+61-2
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,69 @@ pub struct TargetModifier {
8383
pub value_name: String,
8484
}
8585

86+
mod target_modifier_consistency_check {
87+
use super::*;
88+
pub(super) fn sanitizer(l: &TargetModifier, r: &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 = if r.value_name.is_empty() { None } else { Some(r.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: &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+
return l.extend().tech_value == r.extend().tech_value;
121+
}
122+
true
123+
}
124+
}
125+
86126
impl TargetModifier {
87127
pub fn extend(&self) -> ExtendedTargetModifierInfo {
88128
self.opt.reparse(&self.value_name)
89129
}
130+
// Custom consistency check for target modifiers (or default `l.tech_value == r.tech_value`)
131+
pub fn consistent(&self, opts: &Options, other: &TargetModifier) -> bool {
132+
assert!(self.opt == other.opt);
133+
match self.opt {
134+
OptionsTargetModifiers::UnstableOptions(unstable) => match unstable {
135+
UnstableOptionsTargetModifiers::sanitizer => {
136+
return target_modifier_consistency_check::sanitizer(self, other);
137+
}
138+
UnstableOptionsTargetModifiers::sanitizer_cfi_normalize_integers => {
139+
return target_modifier_consistency_check::sanitizer_cfi_normalize_integers(
140+
opts, self, other,
141+
);
142+
}
143+
_ => {}
144+
},
145+
_ => {}
146+
};
147+
self.extend().tech_value == other.extend().tech_value
148+
}
90149
}
91150

92151
fn tmod_push_impl(
@@ -2427,13 +2486,13 @@ options! {
24272486
remark_dir: Option<PathBuf> = (None, parse_opt_pathbuf, [UNTRACKED],
24282487
"directory into which to write optimization remarks (if not specified, they will be \
24292488
written to standard error output)"),
2430-
sanitizer: SanitizerSet = (SanitizerSet::empty(), parse_sanitizers, [TRACKED],
2489+
sanitizer: SanitizerSet = (SanitizerSet::empty(), parse_sanitizers, [TRACKED TARGET_MODIFIER],
24312490
"use a sanitizer"),
24322491
sanitizer_cfi_canonical_jump_tables: Option<bool> = (Some(true), parse_opt_bool, [TRACKED],
24332492
"enable canonical jump tables (default: yes)"),
24342493
sanitizer_cfi_generalize_pointers: Option<bool> = (None, parse_opt_bool, [TRACKED],
24352494
"enable generalizing pointer types (default: no)"),
2436-
sanitizer_cfi_normalize_integers: Option<bool> = (None, parse_opt_bool, [TRACKED],
2495+
sanitizer_cfi_normalize_integers: Option<bool> = (None, parse_opt_bool, [TRACKED TARGET_MODIFIER],
24372496
"enable normalizing integer types (default: no)"),
24382497
sanitizer_dataflow_abilist: Vec<String> = (Vec::new(), parse_comma_list, [TRACKED],
24392498
"additional ABI list files that control how shadow parameters are passed (comma separated)"),

Diff for: tests/codegen/naked-asan.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//@ needs-sanitizer-address
55
//@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static
66

7+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
8+
79
#![crate_type = "lib"]
810
#![no_std]
911
#![feature(abi_x86_interrupt, naked_functions)]

Diff for: tests/codegen/sanitizer/address-sanitizer-globals-tracking.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
//
2121
//@ revisions:ASAN ASAN-FAT-LTO
2222
//@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static
23+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
2324
//@[ASAN] compile-flags:
2425
//@[ASAN-FAT-LTO] compile-flags: -Cprefer-dynamic=false -Clto=fat
2526

Diff for: tests/codegen/sanitizer/cfi/add-canonical-jump-tables-flag.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
55

6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
7+
68
#![crate_type = "lib"]
79

810
pub fn foo() {}

Diff for: tests/codegen/sanitizer/cfi/add-cfi-normalize-integers-flag.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers
55

6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers
7+
68
#![crate_type = "lib"]
79

810
pub fn foo() {}

Diff for: tests/codegen/sanitizer/cfi/add-enable-split-lto-unit-flag.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -Cdebuginfo=1
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78
#![feature(no_sanitize)]

Diff for: tests/codegen/sanitizer/cfi/emit-type-checks.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78
#![feature(cfi_encoding, extern_types)]

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89
#![feature(type_alias_impl_trait)]

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-drop-in-place.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89
#![feature(type_alias_impl_trait)]

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-method-secondary-typeid.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89
#![feature(type_alias_impl_trait)]

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89
#![feature(extern_types)]

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -Zsanitizer-cfi-generalize-pointers
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/emit-type-metadata-trait-objects.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Ctarget-feature=-crt-static -Zsanitizer=cfi
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/external_weak_symbols.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-cfi
55
//@ compile-flags: -Clinker-plugin-lto -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67
#![crate_type = "bin"]
78
#![feature(linkage)]
89

Diff for: tests/codegen/sanitizer/cfi/generalize-pointers.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-generalize-pointers -Copt-level=0
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/cfi/normalize-integers.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-cfi
44
//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Zsanitizer-cfi-normalize-integers -Copt-level=0
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer,sanitizer-cfi-normalize-integers
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/dataflow-instrument-functions.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-dataflow
44
//@ compile-flags: -Copt-level=0 -Zsanitizer=dataflow
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/memory-track-origins.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//@ revisions:MSAN-0 MSAN-1 MSAN-2 MSAN-1-LTO MSAN-2-LTO
66
//
77
//@ compile-flags: -Zsanitizer=memory -Ctarget-feature=-crt-static
8+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
89
//@[MSAN-0] compile-flags:
910
//@[MSAN-1] compile-flags: -Zsanitizer-memory-track-origins=1
1011
//@[MSAN-2] compile-flags: -Zsanitizer-memory-track-origins

Diff for: tests/codegen/sanitizer/no-sanitize-inlining.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//@ needs-sanitizer-leak
66
//@ revisions: ASAN LSAN
77
//@ compile-flags: -Copt-level=3 -Zmir-opt-level=4 -Ctarget-feature=-crt-static
8+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
89
//@[ASAN] compile-flags: -Zsanitizer=address
910
//@[LSAN] compile-flags: -Zsanitizer=leak
1011

Diff for: tests/codegen/sanitizer/no-sanitize.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
//@ needs-sanitizer-address
55
//@ compile-flags: -Zsanitizer=address -Ctarget-feature=-crt-static -Copt-level=0
6+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
67

78
#![crate_type = "lib"]
89
#![feature(no_sanitize)]

Diff for: tests/codegen/sanitizer/safestack-attr-check.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//
33
//@ needs-sanitizer-safestack
44
//@ compile-flags: -Zsanitizer=safestack -Copt-level=0
5+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
56

67
#![crate_type = "lib"]
78

Diff for: tests/codegen/sanitizer/sanitizer-recover.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//@ no-prefer-dynamic
88
//
99
//@ compile-flags: -Ctarget-feature=-crt-static
10+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
1011
//@[ASAN] compile-flags: -Zsanitizer=address -Copt-level=0
1112
//@[ASAN-RECOVER] compile-flags: -Zsanitizer=address -Zsanitizer-recover=address -Copt-level=0
1213
//@[MSAN] compile-flags: -Zsanitizer=memory

Diff for: tests/ui/asm/global-asm-isnt-really-a-mir-body.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ revisions: emit_mir instrument cfi
22

3+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
4+
35
// Make sure we don't try to emit MIR for it.
46
//@[emit_mir] compile-flags: --emit=mir
57

Diff for: tests/ui/lto/issue-100772.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ build-pass
22
//@ needs-sanitizer-cfi
33
//@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
4+
//@ compile-flags: -C unsafe-allow-abi-mismatch=sanitizer
45
//@ no-prefer-dynamic
56
//@ only-x86_64-unknown-linux-gnu
67

0 commit comments

Comments
 (0)