Skip to content

Commit 077e84e

Browse files
committed
linux: gnu/musl: MAP_32BIT is only defined on x86
The Linux kernel only defines MAP_32BIT in the asm/mman.h header on x86. Remove the erraneous definitions for any other architectures on Linux targets. See https://github.com/torvalds/linux/blob/master/arch/x86/include/uapi/asm/mman.h#L5 This makes libc-test somewhat compile on powerpc64le musl. Signed-off-by: Jens Reidel <[email protected]>
1 parent 5303c3a commit 077e84e

File tree

3 files changed

+1
-2
lines changed

3 files changed

+1
-2
lines changed

src/unix/linux_like/linux/gnu/b32/m68k/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ pub const O_NDELAY: c_int = 0x800;
191191
pub const MADV_SOFT_OFFLINE: c_int = 101;
192192
pub const MAP_LOCKED: c_int = 0x02000;
193193
pub const MAP_NORESERVE: c_int = 0x04000;
194-
pub const MAP_32BIT: c_int = 0x0040;
195194
pub const MAP_ANON: c_int = 0x0020;
196195
pub const MAP_ANONYMOUS: c_int = 0x0020;
197196
pub const MAP_DENYWRITE: c_int = 0x0800;

src/unix/linux_like/linux/musl/b64/powerpc64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ s! {
7272
}
7373

7474
pub const MADV_SOFT_OFFLINE: c_int = 101;
75+
#[deprecated = "Linux does not define MAP_32BIT on any architectures other than x86 and x86_64, this constant will be removed in the future"]
7576
pub const MAP_32BIT: c_int = 0x0040;
7677
pub const O_APPEND: c_int = 1024;
7778
pub const O_DIRECT: c_int = 0x20000;

src/unix/linux_like/linux/musl/b64/wasm32/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ pub const SYS_set_mempolicy_home_node: c_long = 450;
441441
pub const SYS_fadvise: c_long = SYS_fadvise64;
442442

443443
pub const MADV_SOFT_OFFLINE: c_int = 101;
444-
pub const MAP_32BIT: c_int = 0x0040;
445444
pub const O_APPEND: c_int = 1024;
446445
pub const O_DIRECT: c_int = 0x4000;
447446
pub const O_DIRECTORY: c_int = 0x10000;

0 commit comments

Comments
 (0)