Skip to content

Commit 0d75940

Browse files
committed
try msvc pauth fix
1 parent 60d1bbf commit 0d75940

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/run-make/pointer-auth-link-with-c/rmake.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@ use run_make_support::{build_native_static_lib, cc, is_windows_msvc, llvm_ar, ru
1515

1616
fn main() {
1717
build_native_static_lib("test");
18+
19+
let branch_protection = if is_windows_msvc() {
20+
"-Zbranch-protection=bti,gcs,pac-ret,leaf,b-key"
21+
} else {
22+
"-Zbranch-protection=bti,gcs,pac-ret,leaf"
23+
};
24+
1825
rustc()
1926
.arg("-Cunsafe-allow-abi-mismatch=branch-protection")
20-
.arg("-Zbranch-protection=bti,gcs,pac-ret,leaf")
27+
.arg(branch_protection)
2128
.input("test.rs")
2229
.run();
2330
run("test");
@@ -31,7 +38,7 @@ fn main() {
3138
llvm_ar().obj_to_ar().output_input("libtest.a", &obj_file).run();
3239
rustc()
3340
.arg("-Cunsafe-allow-abi-mismatch=branch-protection")
34-
.arg("-Zbranch-protection=bti,gcs,pac-ret,leaf")
41+
.arg(branch_protection)
3542
.input("test.rs")
3643
.run();
3744
run("test");

0 commit comments

Comments
 (0)