mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
rewrite relocation-model to rmake
This commit is contained in:
parent
5c8459f1ec
commit
75ee1d74a9
@ -164,7 +164,6 @@ run-make/raw-dylib-inline-cross-dylib/Makefile
|
|||||||
run-make/raw-dylib-link-ordinal/Makefile
|
run-make/raw-dylib-link-ordinal/Makefile
|
||||||
run-make/raw-dylib-stdcall-ordinal/Makefile
|
run-make/raw-dylib-stdcall-ordinal/Makefile
|
||||||
run-make/redundant-libs/Makefile
|
run-make/redundant-libs/Makefile
|
||||||
run-make/relocation-model/Makefile
|
|
||||||
run-make/relro-levels/Makefile
|
run-make/relro-levels/Makefile
|
||||||
run-make/remap-path-prefix-dwarf/Makefile
|
run-make/remap-path-prefix-dwarf/Makefile
|
||||||
run-make/remap-path-prefix/Makefile
|
run-make/remap-path-prefix/Makefile
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
# ignore-cross-compile
|
|
||||||
include ../tools.mk
|
|
||||||
|
|
||||||
all: others
|
|
||||||
$(RUSTC) -C relocation-model=dynamic-no-pic foo.rs
|
|
||||||
$(call RUN,foo)
|
|
||||||
|
|
||||||
$(RUSTC) -C relocation-model=default foo.rs
|
|
||||||
$(call RUN,foo)
|
|
||||||
|
|
||||||
$(RUSTC) -C relocation-model=dynamic-no-pic --crate-type=dylib foo.rs --emit=link,obj
|
|
||||||
|
|
||||||
ifdef IS_MSVC
|
|
||||||
# FIXME(#28026)
|
|
||||||
others:
|
|
||||||
else
|
|
||||||
others:
|
|
||||||
$(RUSTC) -C relocation-model=static foo.rs
|
|
||||||
$(call RUN,foo)
|
|
||||||
endif
|
|
26
tests/run-make/relocation-model/rmake.rs
Normal file
26
tests/run-make/relocation-model/rmake.rs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Generation of position-independent code (PIC) can be altered
|
||||||
|
// through use of the -C relocation-model rustc flag. This test
|
||||||
|
// uses varied values with this flag and checks that compilation
|
||||||
|
// succeeds.
|
||||||
|
// See https://github.com/rust-lang/rust/pull/13340
|
||||||
|
|
||||||
|
//@ ignore-cross-compile
|
||||||
|
|
||||||
|
use run_make_support::{run, rustc};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// FIXME(Oneirical): This first one will likely fail on MSVC due to #28026.
|
||||||
|
// Remove this after try-job
|
||||||
|
rustc().arg("-Crelocation-model=static").input("foo.rs").run();
|
||||||
|
run("foo");
|
||||||
|
rustc().arg("-Crelocation-model=dynamic-no-pic").input("foo.rs").run();
|
||||||
|
run("foo");
|
||||||
|
rustc().arg("-Crelocation-model=default").input("foo.rs").run();
|
||||||
|
run("foo");
|
||||||
|
rustc()
|
||||||
|
.arg("-Crelocation-model=dynamic-no-pic")
|
||||||
|
.crate_type("dylib")
|
||||||
|
.emit("link,obj")
|
||||||
|
.input("foo.rs")
|
||||||
|
.run();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user