]> git.lizzy.rs Git - rust.git/commitdiff
Allow running `x.py test src/test/linkchecker` with `download-llvm = true`
authorJoshua Nelson <jyn514@gmail.com>
Fri, 23 Apr 2021 04:25:39 +0000 (00:25 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Fri, 23 Apr 2021 04:33:21 +0000 (00:33 -0400)
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

index e85f4628fb03a95727e316a67983ae7ba5f6b415..4f2426648fd8afe1c901e5e55265473cca689323 100644 (file)
@@ -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