Skip to content

Commit 43cf384

Browse files
committed
Fix the build on Linux/mips with recent libc
libc just undefined MADV_SOFT_OFFLINE on mips. rust-lang/libc#1365 Fixes #1074
1 parent 7befc42 commit 43cf384

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/sys/mman.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,15 @@ libc_enum!{
139139
#[cfg(any(target_os = "android", target_os = "linux"))]
140140
MADV_UNMERGEABLE,
141141
/// Preserve the memory of each page but offline the original page.
142-
#[cfg(any(target_os = "android", target_os = "linux"))]
142+
#[cfg(any(target_os = "android",
143+
all(target_os = "linux", any(
144+
target_arch = "aarch64",
145+
target_arch = "arm",
146+
target_arch = "ppc",
147+
target_arch = "s390x",
148+
target_arch = "x86",
149+
target_arch = "x86_64",
150+
target_arch = "sparc64"))))]
143151
MADV_SOFT_OFFLINE,
144152
/// Enable Transparent Huge Pages (THP) for pages in the given range.
145153
#[cfg(any(target_os = "android", target_os = "linux"))]

0 commit comments

Comments
 (0)