Skip to content

Commit

Permalink
add run-make test to ensure using rust-lld works
Browse files Browse the repository at this point in the history
using the `-C linker-flavor=gcc:lld -C link-self-contained=linker` stable flags
  • Loading branch information
lqd committed Apr 27, 2022
1 parent f04c944 commit 011aacd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/run-make/rust-lld/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# only-linux
# only-x86_64
# needs-rust-lld

# Ensure that the stable version of `-Zgcc-ld=lld` works:
# - `-C link-self-contained=linker`
# - `-C linker-flavor=gcc:lld`

-include ../../run-make-fulldeps/tools.mk
RUSTC_FLAGS = -C linker-flavor=gcc:lld -C link-self-contained=linker -Z unstable-options -C link-args=-Wl,-v

all:
RUSTC_LOG=rustc_codegen_ssa::back::link=info $(RUSTC) $(RUSTC_FLAGS) empty.rs 2> $(TMPDIR)/output.txt
$(CGREP) "lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld" < $(TMPDIR)/output.txt
$(CGREP) -e "^LLD [0-9]+\.[0-9]+\.[0-9]+" < $(TMPDIR)/output.txt
1 change: 1 addition & 0 deletions src/test/run-make/rust-lld/empty.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fn main() {}

0 comments on commit 011aacd

Please sign in to comment.