Skip to content

Commit 0e86aec

Browse files
committed
Fix rustdoc when cross-compiling on musl
musl can't handle foreign-architecture libraries in LD_LIBRARY_PATH.
1 parent 90883f0 commit 0e86aec

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/bootstrap/bin/rustdoc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ fn main() {
2727
Err(_) => 0,
2828
};
2929

30-
let mut dylib_path = dylib_path();
31-
dylib_path.insert(0, PathBuf::from(libdir.clone()));
32-
3330
let mut cmd = Command::new(rustdoc);
3431

3532
if target.is_some() {
@@ -42,7 +39,7 @@ fn main() {
4239
}
4340

4441
cmd.args(&args);
45-
cmd.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
42+
cmd.env(dylib_path_var(), PathBuf::from(libdir.clone()));
4643

4744
// Force all crates compiled by this compiler to (a) be unstable and (b)
4845
// allow the `rustc_private` feature to link to other unstable crates
@@ -78,7 +75,7 @@ fn main() {
7875
eprintln!(
7976
"rustdoc command: {:?}={:?} {:?}",
8077
dylib_path_var(),
81-
env::join_paths(&dylib_path).unwrap(),
78+
PathBuf::from(libdir.clone()),
8279
cmd,
8380
);
8481
eprintln!("sysroot: {:?}", sysroot);

0 commit comments

Comments
 (0)