Skip to content

Commit a4f3e5f

Browse files
committed
rewrite and slightly rename issue-68794-textrel-on-minimal-lib
1 parent 55b5816 commit a4f3e5f

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ run-make/issue-37839/Makefile
7070
run-make/issue-40535/Makefile
7171
run-make/issue-47384/Makefile
7272
run-make/issue-47551/Makefile
73-
run-make/issue-68794-textrel-on-minimal-lib/Makefile
7473
run-make/issue-69368/Makefile
7574
run-make/issue-83045/Makefile
7675
run-make/issue-83112-incr-test-moved-file/Makefile

tests/run-make/issue-68794-textrel-on-minimal-lib/Makefile

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Verify that no text relocations are accidentally introduced by linking a
2+
// minimal rust staticlib.
3+
// The test links a rust static library into a shared library, and checks that
4+
// the linker doesn't have to flag the resulting file as containing TEXTRELs.
5+
// This bug otherwise breaks Android builds, which forbid TEXTRELs.
6+
// See https://github.com/rust-lang/rust/issues/68794
7+
8+
//@ ignore-cross-compile
9+
//FIXME(Oneirical): check that it works on more than just only-linux
10+
11+
use run_make_support::{
12+
cc, dynamic_lib_name, extra_c_flags, extra_cxx_flags, llvm_readobj, rustc, static_lib_name,
13+
};
14+
15+
fn main() {
16+
rustc().input("foo.rs").run();
17+
cc().input("bar.c")
18+
.input(static_lib_name("foo"))
19+
.out_exe(&dynamic_lib_name("bar"))
20+
.arg("-fPIC")
21+
.arg("-shared")
22+
.args(&extra_c_flags())
23+
.args(&extra_cxx_flags())
24+
.run();
25+
llvm_readobj()
26+
.input(dynamic_lib_name("bar"))
27+
.arg("--dynamic")
28+
.run()
29+
.assert_stdout_not_contains("TEXTREL");
30+
}

0 commit comments

Comments
 (0)