8000 Add loongarch64 support (#4914) · RustPython/RustPython@2c90b12 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c90b12

Browse files
authored
Add loongarch64 support (#4914)
1 parent cf465bd commit 2c90b12

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

stdlib/src/mmap.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,28 @@ mod mmap {
112112
#[pyattr]
113113
use libc::{
114114
MADV_DODUMP, MADV_DOFORK, MADV_DONTDUMP, MADV_DONTFORK, MADV_HUGEPAGE, MADV_HWPOISON,
115-
MADV_MERGEABLE, MADV_NOHUGEPAGE, MADV_REMOVE, MADV_SOFT_OFFLINE, MADV_UNMERGEABLE,
115+
MADV_MERGEABLE, MADV_NOHUGEPAGE, MADV_REMOVE, MADV_UNMERGEABLE,
116116
};
117117

118+
#[cfg(any(
119+
target_os = "android",
120+
all(
121+
target_os = "linux",
122+
any(
123+
target_arch = "aarch64",
124+
target_arch = "arm",
125+
target_arch = "powerpc",
126+
target_arch = "powerpc64",
127+
target_arch = "s390x",
128+
target_arch = "x86",
129+
target_arch = "x86_64",
130+
target_arch = "sparc64"
131+
)
132+
)
133+
))]
134+
#[pyattr]
135+
use libc::MADV_SOFT_OFFLINE;
136+
118137
#[cfg(all(target_os = "linux", target_arch = "x86_64", target_env = "gnu"))]
119138
#[pyattr]
120139
use libc::{MAP_DENYWRITE, MAP_EXECUTABLE, MAP_POPULATE};

stdlib/src/socket.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ mod _socket {
309309
any(
310310
target_arch = "aarch64",
311311
target_arch = "i686",
312+
target_arch = "loongarch64",
312313
target_arch = "mips",
313314
target_arch = "powerpc",
314315
target_arch = "powerpc64",
@@ -359,6 +360,7 @@ mod _socket {
359360
any(
360361
target_arch = "aarch64",
361362
target_arch = "i686",
363+
target_arch = "loongarch64",
362364
target_arch = "mips",
363365
target_arch = "powerpc",
364366
target_arch = "powerpc64",

0 commit comments

Comments
 (0)
0