From 7d4c3889d4e11bdc2e204be2fd4f7c136f8c0f1a Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Fri, 23 Apr 2021 00:25:39 -0400 Subject: [PATCH] Allow running `x.py test src/test/linkchecker` with `download-llvm = true` Previously, the LD_LIBRARY_PATH for the linkchecker looked like `build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib`, because the linkchecker depends on the master copy of the standard library. This is true, but doesn't include the library path for the compiler libraries: ``` /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/error_index_generator: error while loading shared libraries: libLLVM-12-rust-1.53.0-nightly.so: cannot open shared object file: No such file or directory ``` That file is in `build/x86_64-unknown-linux-gnu/stage1/lib/libLLVM-12-rust-1.53.0-nightly.so`, which wasn't included in the dynamic path. This adds `build/x86_64-unknown-linux-gnu/stage1/lib` to the dynamic path for the linkchecker. --- src/bootstrap/tool.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index e85f4628fb0..4f2426648fd 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -392,7 +392,10 @@ pub fn command(builder: &Builder<'_>) -> Command { let compiler = builder.compiler(builder.top_stage.saturating_sub(1), builder.config.build); let mut cmd = Command::new(builder.ensure(ErrorIndex { compiler })); add_dylib_path( - vec![PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host))], + vec![ + PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)), + PathBuf::from(builder.rustc_libdir(compiler)), + ], &mut cmd, ); cmd -- 2.44.0