summaryrefslogtreecommitdiff
path: root/libc-test/build.rs
diff options
context:
space:
mode:
authorgnzlbg <gonzalobg88@gmail.com>2019-05-27 14:09:40 +0200
committergnzlbg <gonzalobg88@gmail.com>2019-05-27 22:23:02 +0200
commit1cbc523e50d7dd37f13330d3ef5b80d84b76705e (patch)
treee577a1fc451ef9de69cd95c47ae8c4c463906bc8 /libc-test/build.rs
parent8f403e5ac262508b763da173d545195710d10494 (diff)
downloadrust-libc-1cbc523e50d7dd37f13330d3ef5b80d84b76705e.tar.gz
[breaking change] MADV_SOFT_OFFLINE is undefined on MIPS
Diffstat (limited to 'libc-test/build.rs')
-rw-r--r--libc-test/build.rs27
1 files changed, 23 insertions, 4 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 9600c72742..987ff9dd89 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1995,6 +1995,10 @@ fn test_linux(target: &str) {
),
}
+ let arm = target.contains("arm");
+ let x86_64 = target.contains("x86_64");
+ let x86_32 = target.contains("i686");
+ let x32 = target.contains("x32");
let mips = target.contains("mips");
let mips32 = mips && !target.contains("64");
@@ -2046,7 +2050,6 @@ fn test_linux(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
- "sys/sysctl.h",
"sys/epoll.h",
"sys/eventfd.h",
"sys/file.h",
@@ -2097,15 +2100,27 @@ fn test_linux(target: &str) {
// `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit ARM:
// https://bugzilla.redhat.com/show_bug.cgi?id=1116162
- if target.contains("x86") || target.contains("arm") {
+ if x86_64 || x86_32 || arm {
headers! { cfg: "sys/io.h" }
}
// `sys/reg.h` is only available on x86 and x86_64
- if target.contains("x86") {
+ if x86_64 || x86_32 {
headers! { cfg: "sys/reg.h" }
}
+ // sysctl system call is deprecated and not available on musl
+ // It is also unsupported in x32:
+ if !(x32 || musl) {
+ headers! { cfg: "sys/sysctl.h"}
+ }
+
+ // <execinfo.h> is not supported by musl:
+ // https://www.openwall.com/lists/musl/2015/04/09/3
+ if !musl {
+ headers! { cfg: "execinfo.h" }
+ }
+
// Include linux headers at the end:
headers! {
cfg:
@@ -2115,7 +2130,6 @@ fn test_linux(target: &str) {
"linux/fs.h",
"linux/futex.h",
"linux/genetlink.h",
- "linux/if.h",
"linux/if_addr.h",
"linux/if_alg.h",
"linux/if_ether.h",
@@ -2138,6 +2152,11 @@ fn test_linux(target: &str) {
"sys/auxv.h",
}
+ // FIXME: https://github.com/sabotage-linux/kernel-headers/issues/16
+ if !musl {
+ headers!{ cfg: "linux/if.h" }
+ }
+
// note: aio.h must be included before sys/mount.h
headers! { cfg:
"sys/xattr.h",