@@ -1995,6 +1995,10 @@ fn test_linux(target: &str) {
1995
1995
) ,
1996
1996
}
1997
1997
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" ) ;
1998
2002
let mips = target. contains ( "mips" ) ;
1999
2003
let mips32 = mips && !target. contains ( "64" ) ;
2000
2004
@@ -2046,7 +2050,6 @@ fn test_linux(target: &str) {
2046
2050
"stdio.h" ,
2047
2051
"stdlib.h" ,
2048
2052
"string.h" ,
2049
- "sys/sysctl.h" ,
2050
2053
"sys/epoll.h" ,
2051
2054
"sys/eventfd.h" ,
2052
2055
"sys/file.h" ,
@@ -2097,15 +2100,26 @@ fn test_linux(target: &str) {
2097
2100
2098
2101
// `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit ARM:
2099
2102
// https://bugzilla.redhat.com/show_bug.cgi?id=1116162
2100
- if target . contains ( "x86" ) || target . contains ( " arm" ) {
2103
+ if x86_64 || x86_32 || arm {
2101
2104
headers ! { cfg: "sys/io.h" }
2102
2105
}
2103
2106
2104
2107
// `sys/reg.h` is only available on x86 and x86_64
2105
- if target . contains ( "x86" ) {
2108
+ if x86_64 || x86_32 {
2106
2109
headers ! { cfg: "sys/reg.h" }
2107
2110
}
2108
2111
2112
+ // sysctl system call is unsupported in x32 kernel:
2113
+ if !x32 {
2114
+ headers ! { cfg: "sys/sysctl.h" }
2115
+ }
2116
+
2117
+ // <execinfo.h> is not supported by musl:
2118
+ // https://www.openwall.com/lists/musl/2015/04/09/3
2119
+ if !musl {
2120
+ headers ! { cfg: "execinfo.h" }
2121
+ }
2122
+
2109
2123
// Include linux headers at the end:
2110
2124
headers ! {
2111
2125
cfg:
0 commit comments