Skip to content

Commit

Permalink
Infer a default musl_root for native builds
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeul committed Mar 6, 2017
1 parent 5eba141 commit 706fc55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ pub fn check(build: &mut Build) {

// Make sure musl-root is valid
if target.contains("musl") {
// 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() {
Expand Down

0 comments on commit 706fc55

Please sign in to comment.