[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)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Wed, 28 Aug 2024 14:44:23 +0000 (16:44 +0200)
commita8f8e7ea3fe5e8344d408191fd62662b3f7da32a
treeffc0bd3d13525dbb40b0ea45351035e9a4e1b30e
parent1fb087735f3108debf8ab34418c6007c1e9c9412
[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