Skip to content

Commit 9f8d584

Browse files
committed
Migrate static-pie to rmake
1 parent e7340a3 commit 9f8d584

File tree

3 files changed

+48
-19
lines changed

3 files changed

+48
-19
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ run-make/split-debuginfo/Makefile
191191
run-make/stable-symbol-names/Makefile
192192
run-make/static-dylib-by-default/Makefile
193193
run-make/static-extern-type/Makefile
194-
run-make/static-pie/Makefile
195194
run-make/staticlib-blank-lib/Makefile
196195
run-make/staticlib-dylib-linkage/Makefile
197196
run-make/std-core-cycle/Makefile

tests/run-make/static-pie/Makefile

-18
This file was deleted.

tests/run-make/static-pie/rmake.rs

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// How to manually run this
2+
// $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie
3+
4+
//@ only-x86_64
5+
//@ only-linux
6+
//@ ignore-32bit
7+
8+
use std::process::Command;
9+
10+
use run_make_support::llvm_readobj;
11+
use run_make_support::rustc;
12+
use run_make_support::{cmd, env_var};
13+
14+
fn ok_compiler_version(compiler: &str) -> bool {
15+
let check_file = format!("check_{compiler}_version.sh");
16+
17+
Command::new(check_file).status().is_ok_and(|status| status.success())
18+
}
19+
20+
fn test(compiler: &str) {
21+
if !ok_compiler_version(compiler) {
22+
return;
23+
}
24+
25+
let target = env_var("TARGET");
26+
27+
rustc()
28+
.input("test-aslr.rs")
29+
.target(&target)
30+
.arg(format!("-Clinker={compiler}"))
31+
.arg("-Clinker-flavor=gcc")
32+
.arg("-Ctarget-feature=+crt-static")
33+
.run();
34+
35+
llvm_readobj()
36+
.symbols()
37+
.input("test-aslr")
38+
.run()
39+
.assert_stdout_not_contains("INTERP")
40+
.assert_stdout_contains("DYNAMIC");
41+
42+
cmd("test-aslr").arg("--test-aslr").run();
43+
}
44+
45+
fn main() {
46+
test("clang");
47+
test("gcc");
48+
}

0 commit comments

Comments
 (0)