File tree Expand file tree Collapse file tree 7 files changed +35
-12
lines changed
compiler/rustc_target/src/spec/targets
src/tools/compiletest/src Expand file tree Collapse file tree 7 files changed +35
-12
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub fn target() -> Target {
1919 stack_probes : StackProbeType :: Inline ,
2020 supported_sanitizers : SanitizerSet :: ADDRESS
2121 | SanitizerSet :: CFI
22+ | SanitizerSet :: KCFI
2223 | SanitizerSet :: LEAK
2324 | SanitizerSet :: MEMORY
2425 | SanitizerSet :: MEMTAG
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ pub fn target() -> Target {
1010 base. static_position_independent_executables = true ;
1111 base. supported_sanitizers = SanitizerSet :: ADDRESS
1212 | SanitizerSet :: CFI
13+ | SanitizerSet :: KCFI
1314 | SanitizerSet :: DATAFLOW
1415 | SanitizerSet :: LEAK
1516 | SanitizerSet :: MEMORY
Original file line number Diff line number Diff line change @@ -826,6 +826,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
826826 "needs-sanitizer-cfi" ,
827827 "needs-sanitizer-dataflow" ,
828828 "needs-sanitizer-hwaddress" ,
829+ "needs-sanitizer-kcfi" ,
829830 "needs-sanitizer-leak" ,
830831 "needs-sanitizer-memory" ,
831832 "needs-sanitizer-memtag" ,
Original file line number Diff line number Diff line change 55//
66// This checks that the reified function pointer will have the expected alias set at its call-site.
77
8- //@ needs-sanitizer- cfi
8+ //@ revisions: cfi kcfi
99// FIXME(#122848) Remove only-linux once OSX CFI binaries work
1010//@ only-linux
11- //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
12- //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
11+ //@ [cfi] needs-sanitizer-cfi
12+ //@ [kcfi] needs-sanitizer-kcfi
13+ //@ compile-flags: -C opt-level=0
14+ //@ [cfi] compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C lto
15+ //@ [cfi] compile-flags: -C prefer-dynamic=off
16+ //@ [cfi] compile-flags: -Z sanitizer=cfi
17+ //@ [kcfi] compile-flags: -Z sanitizer=kcfi
1318//@ run-pass
1419
1520pub fn main ( ) {
Original file line number Diff line number Diff line change 22// * Arc<dyn Foo> as for custom receivers
33// * &dyn Bar<T=Baz> for type constraints
44
5- //@ needs-sanitizer- cfi
5+ //@ revisions: cfi kcfi
66// FIXME(#122848) Remove only-linux once OSX CFI binaries work
77//@ only-linux
8- //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
9- //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
8+ //@ [cfi] needs-sanitizer-cfi
9+ //@ [kcfi] needs-sanitizer-kcfi
10+ //@ compile-flags: -C opt-level=0
11+ //@ [cfi] compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C lto
12+ //@ [cfi] compile-flags: -C prefer-dynamic=off
13+ //@ [cfi] compile-flags: -Z sanitizer=cfi
14+ //@ [kcfi] compile-flags: -Z sanitizer=kcfi
1015//@ run-pass
1116
1217use std:: sync:: Arc ;
Original file line number Diff line number Diff line change 11// Check that encoding self-referential types works with #[repr(transparent)]
22
3- //@ needs-sanitizer- cfi
3+ //@ revisions: cfi kcfi
44// FIXME(#122848) Remove only-linux once OSX CFI binaries work
55//@ only-linux
6- //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
7- //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
6+ //@ [cfi] needs-sanitizer-cfi
7+ //@ [kcfi] needs-sanitizer-kcfi
8+ //@ compile-flags: -C opt-level=0
9+ //@ [cfi] compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C lto
10+ //@ [cfi] compile-flags: -C prefer-dynamic=off
11+ //@ [cfi] compile-flags: -Z sanitizer=cfi
12+ //@ [kcfi] compile-flags: -Z sanitizer=kcfi
813//@ run-pass
914
1015use std:: marker:: PhantomData ;
Original file line number Diff line number Diff line change 11// Tests that calling a trait object method on a trait object with additional auto traits works.
22
3- //@ needs-sanitizer- cfi
3+ //@ revisions: cfi kcfi
44// FIXME(#122848) Remove only-linux once OSX CFI binaries work
55//@ only-linux
6- //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi
7- //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0
6+ //@ [cfi] needs-sanitizer-cfi
7+ //@ [kcfi] needs-sanitizer-kcfi
8+ //@ compile-flags: -C opt-level=0
9+ //@ [cfi] compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C lto
10+ //@ [cfi] compile-flags: -C prefer-dynamic=off
11+ //@ [cfi] compile-flags: -Z sanitizer=cfi
12+ //@ [kcfi] compile-flags: -Z sanitizer=kcfi
813//@ run-pass
914
1015trait Foo {
You can’t perform that action at this time.
0 commit comments