Skip to content

Commit 3c43114

Browse files
authored
Merge pull request #4511 from Gelbpunkt/map-32bit-arches
linux: gnu/musl: MAP_32BIT is only defined on x86
2 parents a883b79 + 9332d56 commit 3c43114

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

libc-test/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4305,6 +4305,11 @@ fn test_linux(target: &str) {
43054305
if old_musl && name == "RLIM_NLIMITS" {
43064306
return true;
43074307
}
4308+
// FIXME: Does not exist on non-x86 architectures, slated for removal
4309+
// in libc in 1.0
4310+
if ppc64 && name == "MAP_32BIT" {
4311+
return true;
4312+
}
43084313
}
43094314
match name {
43104315
// These constants are not available if gnu headers have been included

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ s! {
7272
}
7373

7474
pub const MADV_SOFT_OFFLINE: c_int = 101;
75+
#[deprecated(since = "0.2.175", note = "Linux does not define MAP_32BIT on any architectures \
76+
other than x86 and x86_64, this constant will be removed in the future")]
7577
pub const MAP_32BIT: c_int = 0x0040;
7678
pub const O_APPEND: c_int = 1024;
7779
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)