about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/back/link.rs
diff options
context:
space:
mode:
authorjyn <github@jyn.dev>2025-01-18 16:55:31 -0500
committerjyn <github@jyn.dev>2025-01-25 16:04:52 -0500
commitc1b4ab0e7369836aaabd3e3b5ff2d8c11471e81f (patch)
treef6aaa2947f4223e2c2663949df2e3f8ba2670bf6 /compiler/rustc_codegen_ssa/src/back/link.rs
parentf7cc13af822fe68c64fec0b05aa9dd1412451f7c (diff)
downloadrust-c1b4ab0e7369836aaabd3e3b5ff2d8c11471e81f.tar.gz
rust-c1b4ab0e7369836aaabd3e3b5ff2d8c11471e81f.zip
Shorten linker output even more when `--verbose` is not present
- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long.
- For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell.
- Move `.rlib` to outside the glob.
- Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments.

This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests.

- Only use linker-flavor=gnu-cc if we're actually going to compare the output. It doesn't exist on MacOS.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back/link.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 9688a5d47f2..105a4cb81f0 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1007,6 +1007,7 @@ fn link_natively(
                     command: cmd,
                     escaped_output,
                     verbose: sess.opts.verbose,
+                    sysroot_dir: sess.sysroot.clone(),
                 };
                 sess.dcx().emit_err(err);
                 // If MSVC's `link.exe` was expected but the return code