Skip to content

Commit 04db260

Browse files
committed
Auto merge of #2086 - JohnTitor:s390x-musl, r=JohnTitor
Move `s390x-unknown-linux-musl` to build.sh Fixes #2085 r? `@ghost`
2 parents 5fd6540 + 9f2acfa commit 04db260

File tree

4 files changed

+23
-94
lines changed

4 files changed

+23
-94
lines changed

.github/workflows/bors.yml

-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ jobs:
136136
# FIXME: It seems some items in `src/unix/mod.rs`
137137
# aren't defined on redox actually.
138138
# x86_64-unknown-redox,
139-
# FIXME: Enable when CI is building a toolchain for this target
140-
# s390x-unknown-linux-musl,
141139
]
142140
steps:
143141
- uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master

ci/build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ riscv32imc-unknown-none-elf \
238238
riscv32gc-unknown-linux-gnu \
239239
riscv64gc-unknown-none-elf \
240240
riscv64imac-unknown-none-elf \
241+
s390x-unknown-linux-musl \
241242
sparc-unknown-linux-gnu \
242243
sparc64-unknown-netbsd \
243244

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

+12-90
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
pub type blksize_t = i64;
22
pub type c_char = u8;
3-
pub type c_long = i64;
4-
pub type c_ulong = u64;
53
pub type nlink_t = u64;
6-
pub type suseconds_t = i64;
74
pub type wchar_t = i32;
85
pub type greg_t = u64;
96
pub type __u64 = u64;
107

118
s! {
9+
pub struct ipc_perm {
10+
pub __ipc_perm_key: ::key_t,
11+
pub uid: ::uid_t,
12+
pub gid: ::gid_t,
13+
pub cuid: ::uid_t,
14+
pub cgid: ::gid_t,
15+
pub mode: ::mode_t,
16+
pub __seq: ::c_int,
17+
__pad1: ::c_long,
18+
__pad2: ::c_long,
19+
}
20+
1221
pub struct stat {
1322
pub st_dev: ::dev_t,
1423
pub st_ino: ::ino_t,
@@ -115,46 +124,8 @@ cfg_if! {
115124
}
116125
}
117126

118-
pub const POSIX_FADV_DONTNEED: ::c_int = 6;
119-
pub const POSIX_FADV_NOREUSE: ::c_int = 7;
120-
121127
pub const VEOF: usize = 4;
122128
pub const RTLD_DEEPBIND: ::c_int = 0x8;
123-
pub const RTLD_GLOBAL: ::c_int = 0x100;
124-
pub const RTLD_NOLOAD: ::c_int = 0x4;
125-
pub const SFD_CLOEXEC: ::c_int = 0x080000;
126-
127-
pub const NCCS: usize = 32;
128-
129-
pub const O_TRUNC: ::c_int = 512;
130-
pub const O_NOATIME: ::c_int = 0o1000000;
131-
pub const O_CLOEXEC: ::c_int = 0x80000;
132-
pub const O_PATH: ::c_int = 0o10000000;
133-
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
134-
135-
pub const EBFONT: ::c_int = 59;
136-
pub const ENOSTR: ::c_int = 60;
137-
pub const ENODATA: ::c_int = 61;
138-
pub const ETIME: ::c_int = 62;
139-
pub const ENOSR: ::c_int = 63;
140-
pub const ENONET: ::c_int = 64;
141-
pub const ENOPKG: ::c_int = 65;
142-
pub const EREMOTE: ::c_int = 66;
143-
pub const ENOLINK: ::c_int = 67;
144-
pub const EADV: ::c_int = 68;
145-
pub const ESRMNT: ::c_int = 69;
146-
pub const ECOMM: ::c_int = 70;
147-
pub const EPROTO: ::c_int = 71;
148-
pub const EDOTDOT: ::c_int = 73;
149-
150-
pub const SA_NODEFER: ::c_int = 0x40000000;
151-
pub const SA_RESETHAND: ::c_int = 0x80000000;
152-
pub const SA_RESTART: ::c_int = 0x10000000;
153-
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
154-
155-
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
156-
157-
pub const EFD_CLOEXEC: ::c_int = 0x80000;
158129

159130
pub const EUCLEAN: ::c_int = 117;
160131
pub const ENOTNAM: ::c_int = 118;
@@ -190,24 +161,12 @@ pub const SO_ERROR: ::c_int = 4;
190161
pub const SO_RCVTIMEO: ::c_int = 20;
191162
pub const SO_REUSEADDR: ::c_int = 2;
192163
pub const SO_SNDTIMEO: ::c_int = 21;
193-
pub const SO_BINDTODEVICE: ::c_int = 25;
194-
pub const SO_TIMESTAMP: ::c_int = 29;
195-
pub const SO_MARK: ::c_int = 36;
196164
pub const SO_PROTOCOL: ::c_int = 38;
197165
pub const SO_DOMAIN: ::c_int = 39;
198-
pub const SO_RXQ_OVFL: ::c_int = 40;
199-
pub const SO_PEEK_OFF: ::c_int = 42;
200-
pub const SO_BUSY_POLL: ::c_int = 46;
201166

202167
pub const SOCK_STREAM: ::c_int = 1;
203168
pub const SOCK_DGRAM: ::c_int = 2;
204169

205-
pub const RLIMIT_RSS: ::__rlimit_resource_t = 5;
206-
pub const RLIMIT_AS: ::__rlimit_resource_t = 9;
207-
pub const RLIMIT_MEMLOCK: ::__rlimit_resource_t = 8;
208-
pub const RLIMIT_NOFILE: ::__rlimit_resource_t = 7;
209-
pub const RLIMIT_NPROC: ::__rlimit_resource_t = 6;
210-
211170
pub const O_NOCTTY: ::c_int = 256;
212171
pub const O_SYNC: ::c_int = 1052672;
213172
pub const O_RSYNC: ::c_int = 1052672;
@@ -222,7 +181,6 @@ pub const MAP_GROWSDOWN: ::c_int = 0x0100;
222181
pub const MAP_LOCKED: ::c_int = 0x02000;
223182
pub const MAP_NORESERVE: ::c_int = 0x04000;
224183
pub const MAP_ANON: ::c_int = 0x0020;
225-
pub const MAP_ANONYMOUS: ::c_int = 0x0020;
226184
pub const MAP_DENYWRITE: ::c_int = 0x0800;
227185
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
228186
pub const MAP_POPULATE: ::c_int = 0x08000;
@@ -336,15 +294,12 @@ pub const SIGURG: ::c_int = 23;
336294
pub const SIGIO: ::c_int = 29;
337295
pub const SIGSYS: ::c_int = 31;
338296
pub const SIGSTKFLT: ::c_int = 16;
339-
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
340-
pub const SIGUNUSED: ::c_int = 31;
341297
pub const SIGPOLL: ::c_int = 29;
342298
pub const SIGPWR: ::c_int = 30;
343299
pub const SIG_BLOCK: ::c_int = 0x000000;
344300
pub const SIG_UNBLOCK: ::c_int = 0x01;
345301

346302
pub const O_ASYNC: ::c_int = 0x2000;
347-
pub const O_NDELAY: ::c_int = 0x800;
348303

349304
pub const VEOL: usize = 11;
350305
pub const VEOL2: usize = 16;
@@ -355,16 +310,9 @@ pub const FLUSHO: ::tcflag_t = 0x00001000;
355310

356311
pub const EXTPROC: ::tcflag_t = 0x00010000;
357312

358-
pub const PTRACE_DETACH: ::c_uint = 17;
359-
360313
pub const MCL_CURRENT: ::c_int = 0x0001;
361314
pub const MCL_FUTURE: ::c_int = 0x0002;
362315

363-
pub const EFD_NONBLOCK: ::c_int = 0x800;
364-
365-
pub const F_RDLCK: ::c_int = 0;
366-
pub const F_WRLCK: ::c_int = 1;
367-
pub const F_UNLCK: ::c_int = 2;
368316
pub const F_GETLK: ::c_int = 5;
369317
pub const F_GETOWN: ::c_int = 9;
370318
pub const F_SETOWN: ::c_int = 8;
@@ -374,8 +322,6 @@ pub const F_OFD_GETLK: ::c_int = 36;
374322
pub const F_OFD_SETLK: ::c_int = 37;
375323
pub const F_OFD_SETLKW: ::c_int = 38;
376324

377-
pub const SFD_NONBLOCK: ::c_int = 0x0800;
378-
379325
pub const TCGETS: ::c_int = 0x5401;
380326
pub const TCSETS: ::c_int = 0x5402;
381327
pub const TCSETSW: ::c_int = 0x5403;
@@ -405,12 +351,6 @@ pub const TIOCMBIC: ::c_int = 0x5417;
405351
pub const TIOCMSET: ::c_int = 0x5418;
406352
pub const FIONREAD: ::c_int = 0x541B;
407353
pub const TIOCCONS: ::c_int = 0x541D;
408-
pub const TIOCSBRK: ::c_int = 0x5427;
409-
pub const TIOCCBRK: ::c_int = 0x5428;
410-
411-
pub const TCSANOW: ::c_int = 0;
412-
pub const TCSADRAIN: ::c_int = 1;
413-
pub const TCSAFLUSH: ::c_int = 2;
414354

415355
pub const TIOCLINUX: ::c_int = 0x541C;
416356
pub const TIOCGSERIAL: ::c_int = 0x541E;
@@ -449,24 +389,6 @@ pub const VT1: ::tcflag_t = 0x00004000;
449389
pub const XTABS: ::tcflag_t = 0o014000;
450390

451391
pub const CBAUD: ::speed_t = 0o010017;
452-
pub const B0: ::speed_t = 0o000000;
453-
pub const B50: ::speed_t = 0o000001;
454-
pub const B75: ::speed_t = 0o000002;
455-
pub const B110: ::speed_t = 0o000003;
456-
pub const B134: ::speed_t = 0o000004;
457-
pub const B150: ::speed_t = 0o000005;
458-
pub const B200: ::speed_t = 0o000006;
459-
pub const B300: ::speed_t = 0o000007;
460-
pub const B600: ::speed_t = 0o000010;
461-
pub const B1200: ::speed_t = 0o000011;
462-
pub const B1800: ::speed_t = 0o000012;
463-
pub const B2400: ::speed_t = 0o000013;
464-
pub const B4800: ::speed_t = 0o000014;
465-
pub const B9600: ::speed_t = 0o000015;
466-
pub const B19200: ::speed_t = 0o000016;
467-
pub const B38400: ::speed_t = 0o000017;
468-
pub const EXTA: ::speed_t = B19200;
469-
pub const EXTB: ::speed_t = B38400;
470392
pub const CSIZE: ::tcflag_t = 0o000060;
471393
pub const CS6: ::tcflag_t = 0o000020;
472394
pub const CS7: ::tcflag_t = 0o000040;

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

+10-2
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,6 @@ pub const O_ACCMODE: ::c_int = 0o10000003;
505505
pub const O_NDELAY: ::c_int = O_NONBLOCK;
506506
pub const NI_MAXHOST: ::socklen_t = 255;
507507
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
508-
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
509-
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
510508

511509
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
512510

@@ -644,6 +642,16 @@ pub const PRIO_PROCESS: ::c_int = 0;
644642
pub const PRIO_PGRP: ::c_int = 1;
645643
pub const PRIO_USER: ::c_int = 2;
646644

645+
cfg_if! {
646+
if #[cfg(target_arch = "s390x")] {
647+
pub const POSIX_FADV_DONTNEED: ::c_int = 6;
648+
pub const POSIX_FADV_NOREUSE: ::c_int = 7;
649+
} else {
650+
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
651+
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
652+
}
653+
}
654+
647655
extern "C" {
648656
pub fn sendmmsg(
649657
sockfd: ::c_int,

0 commit comments

Comments
 (0)