Skip to content

Commit 0d68aad

Browse files
committed
Auto merge of #32132 - arcnmx:cargobuild-std-target, r=alexcrichton
cover more linux targets in libstd cargobuild libstd/build.rs checked the target name against `"unknown-linux"`... That doesn't necessarily apply to all Linux targets as some toolchains for embedded targets will change that `unknown` field to some vendor name. Some shifting around was needed since Android is also a Linux target. r? @alexcrichton
2 parents 5807fbb + dbe2389 commit 0d68aad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libstd/build.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ fn main() {
2727
build_libbacktrace(&host, &target);
2828
}
2929

30-
if target.contains("unknown-linux") {
30+
if target.contains("linux") {
3131
if target.contains("musl") && (target.contains("x86_64") || target.contains("i686")) {
3232
println!("cargo:rustc-link-lib=static=unwind");
33+
} else if target.contains("android") {
34+
println!("cargo:rustc-link-lib=dl");
35+
println!("cargo:rustc-link-lib=log");
36+
println!("cargo:rustc-link-lib=gcc");
3337
} else {
3438
println!("cargo:rustc-link-lib=dl");
3539
println!("cargo:rustc-link-lib=rt");
3640
println!("cargo:rustc-link-lib=pthread");
3741
println!("cargo:rustc-link-lib=gcc_s");
3842
}
39-
} else if target.contains("android") {
40-
println!("cargo:rustc-link-lib=dl");
41-
println!("cargo:rustc-link-lib=log");
42-
println!("cargo:rustc-link-lib=gcc");
4343
} else if target.contains("freebsd") {
4444
println!("cargo:rustc-link-lib=execinfo");
4545
println!("cargo:rustc-link-lib=pthread");

0 commit comments

Comments
 (0)