-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #128348 - dingxiangfei2009:allow-shadow-call-stack-sa…
…nitizer, r=tmandry Unconditionally allow shadow call-stack sanitizer for AArch64 It is possible to do so whenever `-Z fixed-x18` is applied. cc ``@Darksonn`` for context The reasoning is that, as soon as reservation on `x18` is forced through the flag `fixed-x18`, on AArch64 the option to instrument with [Shadow Call Stack sanitizer](https://clang.llvm.org/docs/ShadowCallStack.html) is then applicable regardless of the target configuration. At the every least, we would like to relax the restriction on specifically `aarch64-unknonw-none`. For this option, we can include a documentation change saying that users of compiled objects need to ensure that they are linked to runtime with Shadow Call Stack instrumentation support. Related: #121972
- Loading branch information
Showing
6 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/codegen/sanitizer/aarch64-shadow-call-stack-with-fixed-x18.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@ revisions: aarch64 android | ||
//@[aarch64] compile-flags: --target aarch64-unknown-none -Zfixed-x18 -Zsanitizer=shadow-call-stack | ||
//@[aarch64] needs-llvm-components: aarch64 | ||
//@[android] compile-flags: --target aarch64-linux-android -Zsanitizer=shadow-call-stack | ||
//@[android] needs-llvm-components: aarch64 | ||
|
||
#![allow(internal_features)] | ||
#![crate_type = "rlib"] | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
// CHECK: ; Function Attrs:{{.*}}shadowcallstack | ||
#[no_mangle] | ||
pub fn foo() {} | ||
|
||
// CHECK: attributes #0 = {{.*}}shadowcallstack{{.*}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ compile-flags: --target aarch64-unknown-none -Zsanitizer=shadow-call-stack | ||
//@ error-pattern: shadow-call-stack sanitizer is not supported for this target | ||
//@ dont-check-compiler-stderr | ||
//@ needs-llvm-components: aarch64 | ||
|
||
#![allow(internal_features)] | ||
#![crate_type = "rlib"] | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
#[no_mangle] | ||
pub fn foo() {} |