Skip to content

Commit

Permalink
Merge pull request #307 from mixi/master
Browse files Browse the repository at this point in the history
Pass -static depending on crt-static on linux too.
  • Loading branch information
alexcrichton authored Apr 2, 2018
2 parents 7fef736 + 3bdeefd commit a2c478f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,8 +1106,11 @@ impl Build {
cmd.args.push("-m64".into());
}

if self.static_flag.is_none() && target.contains("musl") {
cmd.args.push("-static".into());
if self.static_flag.is_none() {
let features = env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or(String::new());
if features.contains("crt-static") {
cmd.args.push("-static".into());
}
}

// armv7 targets get to use armv7 instructions
Expand Down

0 comments on commit a2c478f

Please sign in to comment.