Skip to content

Commit

Permalink
Migrate static-pie to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Rejyr committed Jun 19, 2024
1 parent e7340a3 commit 591bbf6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 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
Expand Up @@ -191,7 +191,6 @@ run-make/split-debuginfo/Makefile
run-make/stable-symbol-names/Makefile
run-make/static-dylib-by-default/Makefile
run-make/static-extern-type/Makefile
run-make/static-pie/Makefile
run-make/staticlib-blank-lib/Makefile
run-make/staticlib-dylib-linkage/Makefile
run-make/std-core-cycle/Makefile
Expand Down
18 changes: 0 additions & 18 deletions tests/run-make/static-pie/Makefile

This file was deleted.

46 changes: 46 additions & 0 deletions tests/run-make/static-pie/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// How to manually run this
// $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie

//@ only-x86_64
//@ only-linux
//@ ignore-32bit

use std::process::Command;

use run_make_support::llvm_readobj;
use run_make_support::rustc;
use run_make_support::{cmd, target};

fn ok_compiler_version(compiler: &str) -> bool {
let check_file = format!("check_{compiler}_version.sh");

Command::new(check_file).status().is_ok_and(|status| status.success())
}

fn test(compiler: &str) {
if !ok_compiler_version(compiler) {
return;
}

rustc()
.input("test-aslr.rs")
.target(&target())
.linker(compiler)
.arg("-Clinker-flavor=gcc")
.arg("-Ctarget-feature=+crt-static")
.run();

llvm_readobj()
.symbols()
.input("test-aslr")
.run()
.assert_stdout_not_contains("INTERP")
.assert_stdout_contains("DYNAMIC");

cmd("test-aslr").arg("--test-aslr").run();
}

fn main() {
test("clang");
test("gcc");
}

0 comments on commit 591bbf6

Please sign in to comment.