Skip to content

Commit 36bd805

Browse files
committed
fixup
1 parent 2bd632f commit 36bd805

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

libc-test/build.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,10 @@ fn test_linux(target: &str) {
19951995
),
19961996
}
19971997

1998+
let arm = target.contains("arm");
1999+
let x86_64 = target.contains("x86_64");
2000+
let x86_32 = target.contains("i686");
2001+
let x32 = target.contains("x32");
19982002
let mips = target.contains("mips");
19992003
let mips32 = mips && !target.contains("64");
20002004

@@ -2097,23 +2101,26 @@ fn test_linux(target: &str) {
20972101

20982102
// `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit ARM:
20992103
// https://bugzilla.redhat.com/show_bug.cgi?id=1116162
2100-
if target.contains("x86")
2101-
|| target.contains("i686")
2102-
|| target.contains("arm")
2103-
{
2104+
if x86_64 || x86_32 || arm {
21042105
headers! { cfg: "sys/io.h" }
21052106
}
21062107

21072108
// `sys/reg.h` is only available on x86 and x86_64
2108-
if target.contains("x86") || target.contains("i686") {
2109+
if x86_64 || x86_32 {
21092110
headers! { cfg: "sys/reg.h" }
21102111
}
21112112

21122113
// sysctl system call is unsupported in x32 kernel:
2113-
if !target.contains("x32") {
2114+
if !x86_64_32 {
21142115
headers! { cfg: "sys/sysctl.h"}
21152116
}
21162117

2118+
// <execinfo.h> is not supported by musl:
2119+
// https://www.openwall.com/lists/musl/2015/04/09/3
2120+
if !musl {
2121+
headers! { cfg: "execinfo.h" }
2122+
}
2123+
21172124
// Include linux headers at the end:
21182125
headers! {
21192126
cfg:

0 commit comments

Comments
 (0)