Skip to content

Commit

Permalink
Enable combining +crt-static and relocation-model=pic on x86_64-unkno…
Browse files Browse the repository at this point in the history
…wn-linux-gnu
  • Loading branch information
bossmc committed Oct 28, 2021
1 parent f2707fe commit b94da2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/test/run-make/static-pie/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b94da2b

Please sign in to comment.