diff options
author | Alan Somers <asomers@gmail.com> | 2019-06-02 21:09:16 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2019-06-02 21:43:13 -0600 |
commit | d9d908f6e55afd550dd25c5708c8ae396dd26a55 (patch) | |
tree | ef4a9a337c138ebf2ebc96f7589ec63e633e9fa4 /src/sys/mman.rs | |
parent | 974320d09fbd1fae79da537383c2144ed9aa4967 (diff) | |
download | nix-d9d908f6e55afd550dd25c5708c8ae396dd26a55.zip |
Fix the build on Linux/mips with recent libc
libc just undefined MADV_SOFT_OFFLINE on mips.
https://github.com/rust-lang/libc/pull/1365
Fixes #1074
Diffstat (limited to 'src/sys/mman.rs')
-rw-r--r-- | src/sys/mman.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sys/mman.rs b/src/sys/mman.rs index dd92ffc0..4e250501 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -139,7 +139,15 @@ libc_enum!{ #[cfg(any(target_os = "android", target_os = "linux"))] MADV_UNMERGEABLE, /// Preserve the memory of each page but offline the original page. - #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg(any(target_os = "android", + all(target_os = "linux", any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "ppc", + target_arch = "s390x", + target_arch = "x86", + target_arch = "x86_64", + target_arch = "sparc64"))))] MADV_SOFT_OFFLINE, /// Enable Transparent Huge Pages (THP) for pages in the given range. #[cfg(any(target_os = "android", target_os = "linux"))] |