@@ -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,27 @@ 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 deprecated and not available on musl
2113
+ // It is also unsupported in x32:
2114
+ if !( x32 || musl) {
2115
+ headers ! { cfg: "sys/sysctl.h" }
2116
+ }
2117
+
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
+
2109
2124
// Include linux headers at the end:
2110
2125
headers ! {
2111
2126
cfg:
@@ -2115,7 +2130,6 @@ fn test_linux(target: &str) {
2115
2130
"linux/fs.h" ,
2116
2131
"linux/futex.h" ,
2117
2132
"linux/genetlink.h" ,
2118
- "linux/if.h" ,
2119
2133
"linux/if_addr.h" ,
2120
2134
"linux/if_alg.h" ,
2121
2135
"linux/if_ether.h" ,
@@ -2138,6 +2152,11 @@ fn test_linux(target: &str) {
2138
2152
"sys/auxv.h" ,
2139
2153
}
2140
2154
2155
+ // FIXME: https://github.com/sabotage-linux/kernel-headers/issues/16
2156
+ if !musl {
2157
+ headers ! { cfg: "linux/if.h" }
2158
+ }
2159
+
2141
2160
// note: aio.h must be included before sys/mount.h
2142
2161
headers ! { cfg:
2143
2162
"sys/xattr.h" ,
0 commit comments