forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#93782 - adamgemmell:dev/adagem01/split-paut…
…h, r=Amanieu Split `pauth` target feature Per discussion on rust-lang#86941 we'd like to split `pauth` into `paca` and `pacg` in order to better support possible future environments that only have the keys available for address or generic authentication. At the moment LLVM has the one `pauth` target_feature while Linux presents separate `paca` and `pacg` flags for feature detection. Because the use of [target_feature](https://rust-lang.github.io/rfcs/2045-target-feature.html) will "allow the compiler to generate code under the assumption that this code will only be reached in hosts that support the feature", it does not make sense to simply translate `paca` into the LLVM feature `pauth`, as it will generate code as if `pacg` is available. To accommodate this we error if only one of the two features is present. If LLVM splits them in the future we can remove this restriction without making a breaking change. r? ``@Amanieu``
- Loading branch information
Showing
9 changed files
with
148 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: Target features paca, pacg must all be enabled or disabled together | ||
|
||
error: aborting due to previous error | ||
|
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,9 @@ | ||
// only-aarch64 | ||
// revisions: one two three four | ||
//[one] compile-flags: -C target-feature=+paca | ||
//[two] compile-flags: -C target-feature=-pacg,+pacg | ||
//[three] compile-flags: -C target-feature=+paca,+pacg,-paca | ||
//[four] check-pass | ||
//[four] compile-flags: -C target-feature=-paca,+pacg -C target-feature=+paca | ||
|
||
fn main() {} |
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,4 @@ | ||
error: Target features paca, pacg must all be enabled or disabled together | ||
|
||
error: aborting due to previous error | ||
|
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,4 @@ | ||
error: Target features paca, pacg must all be enabled or disabled together | ||
|
||
error: aborting due to previous error | ||
|
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,29 @@ | ||
// only-aarch64 | ||
// build-fail | ||
|
||
#![feature(aarch64_target_feature, target_feature_11)] | ||
|
||
fn main() { | ||
#[target_feature(enable = "pacg")] | ||
//~^ ERROR must all be either enabled or disabled together | ||
unsafe fn inner() {} | ||
|
||
unsafe { | ||
foo(); | ||
bar(); | ||
baz(); | ||
inner(); | ||
} | ||
} | ||
|
||
#[target_feature(enable = "paca")] | ||
//~^ ERROR must all be either enabled or disabled together | ||
unsafe fn foo() {} | ||
|
||
|
||
#[target_feature(enable = "paca,pacg")] | ||
unsafe fn bar() {} | ||
|
||
#[target_feature(enable = "paca")] | ||
#[target_feature(enable = "pacg")] | ||
unsafe fn baz() {} |
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,18 @@ | ||
error: the target features paca, pacg must all be either enabled or disabled together | ||
--> $DIR/tied-features.rs:7:5 | ||
| | ||
LL | #[target_feature(enable = "pacg")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add the missing features in a `target_feature` attribute | ||
|
||
error: the target features paca, pacg must all be either enabled or disabled together | ||
--> $DIR/tied-features.rs:19:1 | ||
| | ||
LL | #[target_feature(enable = "paca")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add the missing features in a `target_feature` attribute | ||
|
||
error: aborting due to 2 previous errors | ||
|