Auto merge of #85961 - 1000teslas:issue-71519-fix, r=petrochenkov
MVP for using rust-lld as part of cc Will fix #71519. I need to figure out how to write a test showing that lld is used instead of whatever linker cc normally uses. When I manually run rustc using `echo 'fn main() {}' | RUSTC_LOG=rustc_codegen_ssa:🔙:link=debug ./rustc -Clinker-flavor=gcc-lld --crate-type bin -Clink-arg=-Wl,-v` (thanks to bjorn3 on Zulip), I can see that lld is used, but I'm not sure how to inspect that output in a test.
This commit is contained in:
commit
72868e017b
8 changed files with 82 additions and 1 deletions
6
src/test/run-make/issue-71519/Makefile
Normal file
6
src/test/run-make/issue-71519/Makefile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-include ../../run-make-fulldeps/tools.mk
|
||||
|
||||
# needs-rust-lld
|
||||
all:
|
||||
RUSTC_LOG=rustc_codegen_ssa::back::link=info $(RUSTC) -Z gcc-ld=lld -C link-args=-Wl,-v main.rs 2> $(TMPDIR)/output.txt
|
||||
$(CGREP) -e "^LLD [0-9]+\.[0-9]+\.[0-9]+" < $(TMPDIR)/output.txt
|
||||
4
src/test/run-make/issue-71519/main.rs
Normal file
4
src/test/run-make/issue-71519/main.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// test linking using cc with rust-lld injected into search path as ld
|
||||
// see rust-lang/rust#71519 for more info
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue