Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cf54f94

Browse files
committedJun 19, 2024
(wip) Migrate branch-protection-check-IBT to rmake
1 parent 740833e commit cf54f94

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
run-make/archive-duplicate-names/Makefile
22
run-make/atomic-lock-free/Makefile
3-
run-make/branch-protection-check-IBT/Makefile
43
run-make/c-dynamic-dylib/Makefile
54
run-make/c-dynamic-rlib/Makefile
65
run-make/c-static-dylib/Makefile

‎tests/run-make/branch-protection-check-IBT/Makefile

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Check for GNU Property Note
2+
3+
// How to run this
4+
// python3 x.py test --target x86_64-unknown-linux-gnu tests/run-make/branch-protection-check-IBT/
5+
6+
//@ only-x86_64
7+
8+
use run_make_support::llvm_readobj;
9+
use run_make_support::rustc;
10+
use run_make_support::{cwd, env_var, llvm_components_contain};
11+
12+
fn main() {
13+
if !llvm_components_contain("x86") {
14+
return;
15+
}
16+
17+
rustc()
18+
.input("main.rs")
19+
.target("x86_64-unknown-linux-gnu")
20+
.arg("-Zcf-protection=branch")
21+
.arg(format!("-L{}", cwd().display()))
22+
.arg("-Clink-args=-nostartfiles")
23+
.arg("-Csave-temps")
24+
.run();
25+
26+
llvm_readobj().notes().input("main").run().assert_stdout_contains(".note.gnu.property");
27+
}

0 commit comments

Comments
 (0)
Failed to load comments.