Skip to content

Commit 011aacd

Browse files
committed
add run-make test to ensure using rust-lld works
using the `-C linker-flavor=gcc:lld -C link-self-contained=linker` stable flags
1 parent f04c944 commit 011aacd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/test/run-make/rust-lld/Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# only-linux
2+
# only-x86_64
3+
# needs-rust-lld
4+
5+
# Ensure that the stable version of `-Zgcc-ld=lld` works:
6+
# - `-C link-self-contained=linker`
7+
# - `-C linker-flavor=gcc:lld`
8+
9+
-include ../../run-make-fulldeps/tools.mk
10+
RUSTC_FLAGS = -C linker-flavor=gcc:lld -C link-self-contained=linker -Z unstable-options -C link-args=-Wl,-v
11+
12+
all:
13+
RUSTC_LOG=rustc_codegen_ssa::back::link=info $(RUSTC) $(RUSTC_FLAGS) empty.rs 2> $(TMPDIR)/output.txt
14+
$(CGREP) "lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld" < $(TMPDIR)/output.txt
15+
$(CGREP) -e "^LLD [0-9]+\.[0-9]+\.[0-9]+" < $(TMPDIR)/output.txt

src/test/run-make/rust-lld/empty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fn main() {}

0 commit comments

Comments
 (0)