Skip to content

Do not emit multiple independent notes on linker errors - #151345

Open
estebank wants to merge 10 commits into
rust-lang:mainfrom
estebank:codegen_errors
Open

estebank wants to merge 10 commits into
rust-lang:mainfrom
estebank:codegen_errors

Conversation

@estebank

@estebank estebank commented Jan 18, 2026 •

Copy link
Copy Markdown
Contributor

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 18, 2026
@rustbot

rustbot commented Jan 18, 2026

Copy link
Copy Markdown
Collaborator

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@estebank
estebank force-pushed the codegen_errors branch 2 times, most recently from cc96533 to 1c77657 Compare January 18, 2026 22:44
@rust-log-analyzer

This comment has been minimized.

@Kivooeo

Kivooeo commented Jan 18, 2026 •

Copy link
Copy Markdown
Member

r? me

i'd highly appreciate some context or elaboration on changes, like, why do we want to change it and/or what's bad about current approach (it's fine if you provide it later, no rush here)

oh, and also it might take some time, i will try to take a look as soon as possible but review time might be up like to day or two

and if it's not yet ready to be reviewed (i assume it isn't because of draft tag) could you give me some sort of signal when it's ready

@rustbot rustbot assigned Kivooeo and unassigned jdonszelmann Jan 18, 2026
@estebank

estebank commented Jan 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@Kivooeo right now I'm just trying to see if these errors are being tested anywhere (while not with access to a windows machine to do so), hence the early publication of the PR.

I noticed this thread where the output was

error: linker `link.exe` not found
  |
  = note: program not found

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.

note: VS Code is a different product, and is not sufficient.

error: could not compile `Fundamentals` (bin "Fundamentals") due to 1 previous error

which doesn't really follow the "grammar" of our errors, by having related information rendered as independent notes.

The output should instead be closer to

error: linker `link.exe` not found
  |
  = note: program not found
  = note: the msvc targets depend on the msvc linker but `link.exe` was not found
  = note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option
  = note: you can obtain "Build Tools for Visual Studio" from <https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2026>
  = note: VS Code is a different product, and is not sufficient

Initially just wanted to add the link, but as I looked around in that file I noticed that there were two similar cases using the same, IMO, bad strategy. So I tried to unify them. I'll update the PR description once 1) I've validated that these are being tested at all (I don't think they are) and 2) I've cleaned it up further.

@jyn514

jyn514 commented Jan 19, 2026

Copy link
Copy Markdown
Member

I have a windows machine I can use to test this if that’s helpful.

@jyn514

jyn514 commented Jan 19, 2026

Copy link
Copy Markdown
Member

I believe windows also has free ISOs on their website, which you can run in a VM.

@estebank

Copy link
Copy Markdown
Contributor Author

@jyn514 yes, I'll try to replicate these cases manually. I don't think we are testing them :-/

It is about half a dozen individual cases, not all of which I'm confident I can trigger :)

@rust-bors

This comment has been minimized.

@ChrisDenton

ChrisDenton commented Feb 6, 2026 •

Copy link
Copy Markdown
Member

@jyn514 yes, I'll try to replicate these cases manually. I don't think we are testing them :-/

It is about half a dozen individual cases, not all of which I'm confident I can trigger :)

These are hard to test in CI due to relying (in part) on how (or if) Visual Studio is set up and whether or not msys2's tools are in PATH. I think we can do better by setting environment variables to change what's in PATH and to manipulate find-msvc-tools in to behaving in different ways. But I don't think that would be perfect either.

@Enselic Enselic added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 17, 2026
@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@estebank

estebank commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Trying to write tests for this on a Windows machine triggered linker errors that frankly look baffling 😵

@estebank

estebank commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

I looked at fooling find-msvc-tools, but it doesn't just look at env vars, it also looks into the registry. I don't think I'll be able to test all the configurations unless I build a separate windows test environment for each of them.

I'll be more than happy to make more tests if someone with Windows expertise can guide me further.

@estebank estebank changed the title [draft] Do not emit multiple independent notes on linker errors Do not emit multiple independent notes on linker errors Oct 5, 2026
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Oct 5, 2026
@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 5, 2026
@rust-log-analyzer

This comment has been minimized.

@ChrisDenton

ChrisDenton commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

I looked at fooling find-msvc-tools, but it doesn't just look at env vars, it also looks into the registry. I don't think I'll be able to test all the configurations unless I build a separate windows test environment for each of them.

I'll be more than happy to make more tests if someone with Windows expertise can guide me further.

See: https://github.com/rust-lang/cc-rs/blob/c8a378e0a15de6726677b6fde713c8a1910cb520/find-msvc-tools/src/find_tools.rs#L445

To override you should be able to set the environment to something like (assuming a x86_64 target):

VCINSTALLDIR=something
VSCMD_ARG_TGT_ARCH=x64

Then all you need is to have link.exe in PATH.

@estebank

estebank commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

@ChrisDenton I tried that by setting

rustc().env("VCINSTALLDIR", "non_existent").env("VSCMD_ARG_TGT_ARCH", "x64")

and a few other variations, but couldn't get it to stop the linker from being picked up.


As I wrote that above I peeked at what fn env does, and it is... Unix-centric. All it does is prepend those env vars before the command. On Windows, it should be doing something like set "VCINSTALLDIR=non_existent" && ... && set "VCINSTALLDIR=..."...


Even after manually setting the env vars, that didn't seem to work :-/

@estebank

Copy link
Copy Markdown
Contributor Author

CC #110763.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/linker-warning stdout ----

error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED -u __STD_REMAP_DEBUGINFO_ENABLED AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64 -w" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64 -w" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH=":/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils abi aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cas cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dtlto dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes plugins powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support supportlsp symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_CODEGEN_BACKEND="gcc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" __BOOTSTRAP_JOBS="4" __RMAKE_VERBOSE_SUBPROCESS_OUTPUT="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake"
stdout: none
--- stderr -------------------------------
LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "fake-linker.rs" "-o" "fake-linker" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===



LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "foo.rs" "--crate-type" "rlib" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===



LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "bar.rs" "--crate-type" "rlib" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===



LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_warn" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===
warning: linker stderr: bar
---




LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_info" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===
warning: linker stdout: foo
---




LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_warn" "-Dlinker-messages" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 1`
=== STDOUT ===



=== STDERR ===
error: linker stderr: bar
---




LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_warn" "-Dwarnings" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 0`
=== STDOUT ===



=== STDERR ===
warning: linker stderr: bar
---




LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_error" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 1`
=== STDOUT ===



=== STDERR ===
error: linking with `./fake-linker` failed: exit status: 1
 |
 = note: executed command:
         "./fake-linker" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/rustceOkjOl/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/{libfoo,libbar}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/rustceOkjOl/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-fno-lto" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
 = note: some arguments are omitted; use `--verbose` to show all linker arguments
 = note: command output:
         error: baz
         

error: aborting due to 1 previous error




LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_error" "--verbose" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 1`
=== STDOUT ===



=== STDERR ===
error: linking with `./fake-linker` failed: exit status: 1
 |
 = note: executed command:
         LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin/self-contained:/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "./fake-linker" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/rustcsfs0Zq/symbols.o" "main.main.d17f5fbe6225cf88-cgu.0.rcgu.o" "main.2uoctswmurc6ir5rvoay0p9ke.rcgu.o" "-Wl,--as-needed" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/libfoo.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/libbar.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-30edba2fadca48d9.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-3845f1d7f62413b0.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-f3c29afc3bc32338.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-e51ea124abe72c2d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-20c01daf20b49489.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-8bc809365b29ff9b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-547f986f02f45a57.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-43e303a48b2af394.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-bc723f0619fdb956.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-a0eaddecc718db8d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-6beeac7e43769c4d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-beae45dc7ff39002.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2-89feecab5d8d4675.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-c66b213a1115e82e.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-931435a0f6c50e0d.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-22d9d10f47369611.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-d8016ef52405bb95.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-4119d3e681338274.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3788082ee4b3e62c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/rustcsfs0Zq/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-fno-lto" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
 = note: command output:
         error: baz
         

error: aborting due to 1 previous error




LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib::/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-Zcodegen-backend=gcc" "--edition" "2015" "main.rs" "-Clink-self-contained=-linker" "-Zunstable-options" "-Wlinker-messages" "--extern" "foo" "--extern" "bar" "-o" "main" "-Clinker=./fake-linker" "-Clinker-flavor=gnu-cc" "-Clink-arg=run_make_error" "--target=x86_64-unknown-linux-gnu"
output status: `exit status: 1`
=== STDOUT ===



=== STDERR ===
error: linking with `./fake-linker` failed: exit status: 1
 |
 = note: executed command:
         "./fake-linker" "-m64" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/rustcxnY3Ow/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/{libfoo,libbar}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/rustcxnY3Ow/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-fno-lto" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
 = note: some arguments are omitted; use `--verbose` to show all linker arguments
 = note: command output:
         error: baz
         

error: aborting due to 1 previous error

Important

For more information how to resolve CI failures of this job, visit this link.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants