diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/sanity.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 436a13500f2..a64a6130929 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -151,8 +151,15 @@ pub fn check(build: &mut Build) { panic!("the iOS target is only supported on macOS"); } - // Make sure musl-root is valid if specified + // Make sure musl-root is valid if target.contains("musl") && !target.contains("mips") { + // If this is a native target (host is also musl) and no musl-root is given, + // fall back to the system toolchain in /usr before giving up + if build.musl_root(*target).is_none() && build.config.build == *target { + let target = build.config.target_config.entry(target.clone()) + .or_insert(Default::default()); + target.musl_root = Some("/usr".into()); + } match build.musl_root(*target) { Some(root) => { if fs::metadata(root.join("lib/libc.a")).is_err() { |
