diff options
| author | bors <bors@rust-lang.org> | 2016-09-04 10:22:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-04 10:22:26 -0700 |
| commit | 9cc430d2cf90a38880e02bb319a5563cbe07a40c (patch) | |
| tree | f54ad8408cfb10263da55fa01fa00cb41e8977af /src | |
| parent | 987b47549eae03e4d9699336f5e30f787161acaa (diff) | |
| parent | 25145b2ef18b872bf46b939126d607b9107e9966 (diff) | |
| download | rust-9cc430d2cf90a38880e02bb319a5563cbe07a40c.tar.gz rust-9cc430d2cf90a38880e02bb319a5563cbe07a40c.zip | |
Auto merge of #36144 - japaric:rustbuild-musl, r=alexcrichton
rustbuild: fix building std for musl targets closes #36143 r? @alexcrichton
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/compile.rs | 6 | ||||
| -rw-r--r-- | src/libstd/build.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 302ac68460c..5ce106b4544 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -93,16 +93,16 @@ pub fn std_link(build: &Build, add_to_sysroot(&out_dir, &libdir); if target.contains("musl") && !target.contains("mips") { - copy_third_party_objects(build, target, &libdir); + copy_musl_third_party_objects(build, &libdir); } } /// Copies the crt(1,i,n).o startup objects /// /// Only required for musl targets that statically link to libc -fn copy_third_party_objects(build: &Build, target: &str, into: &Path) { +fn copy_musl_third_party_objects(build: &Build, into: &Path) { for &obj in &["crt1.o", "crti.o", "crtn.o"] { - copy(&compiler_file(build.cc(target), obj), &into.join(obj)); + copy(&build.config.musl_root.as_ref().unwrap().join("lib").join(obj), &into.join(obj)); } } diff --git a/src/libstd/build.rs b/src/libstd/build.rs index 9018e48d06b..2d540c6b59a 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -35,7 +35,7 @@ fn main() { println!("cargo:rustc-link-lib=dl"); println!("cargo:rustc-link-lib=log"); println!("cargo:rustc-link-lib=gcc"); - } else { + } else if !target.contains("musl") || target.contains("mips") { println!("cargo:rustc-link-lib=dl"); println!("cargo:rustc-link-lib=rt"); println!("cargo:rustc-link-lib=pthread"); |
