[PATCH] Set the host library path in run-make v2
authorFabian Grünbichler <debian@fabian.gruenbichler.email>
Thu, 20 Jun 2024 19:58:10 +0000 (21:58 +0200)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Mon, 24 Jun 2024 06:25:58 +0000 (08:25 +0200)
commitdf7d78cde8c1a922831b71873d8fb3253b4f8aeb
treecd792890d456562b754d8fdfaf7ff4c20dba8889
parent9898e54a3a2abcf9e2321e62bb1e4d165fc740da
[PATCH] Set the host library path in run-make v2

When the build is configured with `[rust] rpath = false`, we need to set
`LD_LIBRARY_PATH` (or equivalent) to what would have been the `RPATH`,
so the compiler can find its own libraries. The old `tools.mk` code has
this environment prefixed in the `$(BARE_RUSTC)` variable, so we just
need to wire up something similar for run-make v2.

This is now set while building each `rmake.rs` itself, as well as in the
`rust-make-support` helpers for `rustc` and `rustdoc` commands. This is
also available in a `set_host_rpath` function for manual commands, like
in the `compiler-builtins` test.

FG: Partial backport for 1.78
Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
Forwarded: https://github.com/rust-lang/rust/pull/123763

Gbp-Pq: Topic upstream
Gbp-Pq: Name u-set-the-host-library-path-in-run-make-v2.patch
src/tools/compiletest/src/runtest.rs
src/tools/run-make-support/src/lib.rs