rewrite and slightly rename issue-68794-textrel-on-minimal-lib
This commit is contained in:
parent
55b581689d
commit
a4f3e5f725
@ -70,7 +70,6 @@ run-make/issue-37839/Makefile
|
||||
run-make/issue-40535/Makefile
|
||||
run-make/issue-47384/Makefile
|
||||
run-make/issue-47551/Makefile
|
||||
run-make/issue-68794-textrel-on-minimal-lib/Makefile
|
||||
run-make/issue-69368/Makefile
|
||||
run-make/issue-83045/Makefile
|
||||
run-make/issue-83112-incr-test-moved-file/Makefile
|
||||
|
@ -1,18 +0,0 @@
|
||||
# ignore-cross-compile
|
||||
# Regression test for issue #68794
|
||||
#
|
||||
# Verify that no text relocations are accidentally introduced by linking a
|
||||
# minimal rust staticlib.
|
||||
#
|
||||
# The test links a rust static library into a shared library, and checks that
|
||||
# the linker doesn't have to flag the resulting file as containing TEXTRELs.
|
||||
|
||||
include ../tools.mk
|
||||
|
||||
# only-linux
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs
|
||||
$(CC) bar.c $(call STATICLIB,foo) -fPIC -shared -o $(call DYLIB,bar) \
|
||||
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
|
||||
readelf -d $(call DYLIB,bar) | grep TEXTREL; test $$? -eq 1
|
30
tests/run-make/textrel-on-minimal-lib/rmake.rs
Normal file
30
tests/run-make/textrel-on-minimal-lib/rmake.rs
Normal file
@ -0,0 +1,30 @@
|
||||
// Verify that no text relocations are accidentally introduced by linking a
|
||||
// minimal rust staticlib.
|
||||
// The test links a rust static library into a shared library, and checks that
|
||||
// the linker doesn't have to flag the resulting file as containing TEXTRELs.
|
||||
// This bug otherwise breaks Android builds, which forbid TEXTRELs.
|
||||
// See https://github.com/rust-lang/rust/issues/68794
|
||||
|
||||
//@ ignore-cross-compile
|
||||
//FIXME(Oneirical): check that it works on more than just only-linux
|
||||
|
||||
use run_make_support::{
|
||||
cc, dynamic_lib_name, extra_c_flags, extra_cxx_flags, llvm_readobj, rustc, static_lib_name,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
rustc().input("foo.rs").run();
|
||||
cc().input("bar.c")
|
||||
.input(static_lib_name("foo"))
|
||||
.out_exe(&dynamic_lib_name("bar"))
|
||||
.arg("-fPIC")
|
||||
.arg("-shared")
|
||||
.args(&extra_c_flags())
|
||||
.args(&extra_cxx_flags())
|
||||
.run();
|
||||
llvm_readobj()
|
||||
.input(dynamic_lib_name("bar"))
|
||||
.arg("--dynamic")
|
||||
.run()
|
||||
.assert_stdout_not_contains("TEXTREL");
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user