Skip to content

Commit 43119de

Browse files
authored
Rollup merge of #70591 - cuviper:fulldeps-library-path, r=Mark-Simulacrum
Ensure LLVM is in the link path for "fulldeps" tests This is a follow-up to #70123, which added `llvm-config --libdir` to the `LIBRARY_PATH` for rustc tools. We need the same for "run-make-fulldeps" and "ui-fulldeps" tests which depend on compiler libraries, implicitly needing to link to `-lLLVM` as well.
2 parents 90cecab + 6067315 commit 43119de

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bootstrap/test.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::flags::Subcommand;
2121
use crate::native;
2222
use crate::tool::{self, SourceType, Tool};
2323
use crate::toolstate::ToolState;
24-
use crate::util::{self, dylib_path, dylib_path_var};
24+
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var};
2525
use crate::Crate as CargoCrate;
2626
use crate::{envify, DocTests, GitRepo, Mode};
2727

@@ -1178,6 +1178,15 @@ impl Step for Compiletest {
11781178
cmd.arg("--system-llvm");
11791179
}
11801180

1181+
// Tests that use compiler libraries may inherit the `-lLLVM` link
1182+
// requirement, but the `-L` library path is not propagated across
1183+
// separate compilations. We can add LLVM's library path to the
1184+
// platform-specific environment variable as a workaround.
1185+
if !builder.config.dry_run && suite.ends_with("fulldeps") {
1186+
let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir"));
1187+
add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd);
1188+
}
1189+
11811190
// Only pass correct values for these flags for the `run-make` suite as it
11821191
// requires that a C++ compiler was configured which isn't always the case.
11831192
if !builder.config.dry_run && suite == "run-make-fulldeps" {

0 commit comments

Comments
 (0)