Skip to content

Commit eb2c71c

Browse files
committed
bootstrap: don't use libraries from MUSL_ROOT on non-musl targets.
1 parent f083c32 commit eb2c71c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,12 @@ fn main() {
129129
// Help the libc crate compile by assisting it in finding the MUSL
130130
// native libraries.
131131
if let Some(s) = env::var_os("MUSL_ROOT") {
132-
let mut root = OsString::from("native=");
133-
root.push(&s);
134-
root.push("/lib");
135-
cmd.arg("-L").arg(&root);
132+
if target.contains("musl") {
133+
let mut root = OsString::from("native=");
134+
root.push(&s);
135+
root.push("/lib");
136+
cmd.arg("-L").arg(&root);
137+
}
136138
}
137139

138140
// Override linker if necessary.

0 commit comments

Comments
 (0)