Skip to content

Commit

Permalink
(wip) Migrate branch-protection-check-IBT to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Rejyr committed Jun 20, 2024
1 parent a11332a commit bc6f8fa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
run-make/archive-duplicate-names/Makefile
run-make/atomic-lock-free/Makefile
run-make/branch-protection-check-IBT/Makefile
run-make/c-dynamic-dylib/Makefile
run-make/c-dynamic-rlib/Makefile
run-make/c-static-dylib/Makefile
Expand Down
15 changes: 0 additions & 15 deletions tests/run-make/branch-protection-check-IBT/Makefile

This file was deleted.

27 changes: 27 additions & 0 deletions tests/run-make/branch-protection-check-IBT/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Check for GNU Property Note

// How to run this
// python3 x.py test --target x86_64-unknown-linux-gnu tests/run-make/branch-protection-check-IBT/

//@ only-x86_64

use run_make_support::llvm_readobj;
use run_make_support::rustc;
use run_make_support::{cwd, env_var, llvm_components_contain};

fn main() {
if !llvm_components_contain("x86") {
return;
}

rustc()
.input("main.rs")
.target("x86_64-unknown-linux-gnu")
.arg("-Zcf-protection=branch")
.arg(format!("-L{}", cwd().display()))
.arg("-Clink-args=-nostartfiles")
.arg("-Csave-temps")
.run();

llvm_readobj().notes().input("main").run().assert_stdout_contains(".note.gnu.property");
}

0 comments on commit bc6f8fa

Please sign in to comment.