diff options
| author | Andy Caldwell <andrew.caldwell@metaswitch.com> | 2021-06-16 19:56:38 +0100 |
|---|---|---|
| committer | Andy Caldwell <andrew.caldwell@metaswitch.com> | 2021-10-28 15:32:37 +0100 |
| commit | b94da2bace66b4ba5485363ac7ba4fe85ad41578 (patch) | |
| tree | 01c69d36b1b8c29d7dc878c43edbb97d9eb83f03 | |
| parent | f2707fec04f655cdf18388618881748ebbd683e9 (diff) | |
| download | rust-b94da2bace66b4ba5485363ac7ba4fe85ad41578.tar.gz rust-b94da2bace66b4ba5485363ac7ba4fe85ad41578.zip | |
Enable combining +crt-static and relocation-model=pic on x86_64-unknown-linux-gnu
| -rw-r--r-- | compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs | 1 | ||||
| -rw-r--r-- | src/test/run-make/static-pie/Makefile | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs index c2484f2d8f6..aefbb398286 100644 --- a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs @@ -7,6 +7,7 @@ pub fn target() -> Target { base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m64".to_string()); // don't use probe-stack=inline-asm until rust#83139 and rust#84667 are resolved base.stack_probes = StackProbeType::Call; + base.static_position_independent_executables = true; base.supported_sanitizers = SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK diff --git a/src/test/run-make/static-pie/Makefile b/src/test/run-make/static-pie/Makefile index 1d3cc821389..f5fe4bc5afe 100644 --- a/src/test/run-make/static-pie/Makefile +++ b/src/test/run-make/static-pie/Makefile @@ -1,9 +1,11 @@ -include ../../run-make-fulldeps/tools.mk -# only-x86_64-unknown-linux-musl +# only-x86_64 +# only-linux +# ignore-gnux32 # How to manually run this -# $ ./x.py test --target x86_64-unknown-linux-musl src/test/run-make/static-pie +# $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] src/test/run-make/static-pie all: $(RUSTC) --target $(TARGET) -C target-feature=+crt-static test-aslr.rs |
