Skip to content

Commit b988ca5

Browse files
authored
Merge pull request #4318 from tgross35/backport-morel
[0.2] Backports
2 parents c6ad434 + 5746f8e commit b988ca5

File tree

15 files changed

+149
-18
lines changed

15 files changed

+149
-18
lines changed

ci/docker/sparc64-unknown-linux-gnu/Dockerfile

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
# FIXME(sparc): newer versions of Ubuntu get the following errors
2-
# ```
3-
# /prog: /lib/sparc64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /prog)
4-
# /prog: /lib/sparc64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found (required by /prog)
5-
# ```
6-
# Not sure if this is a problem from rustc, our libc, or Ubuntu so we just
7-
# stick with an old LTS for now.
8-
FROM ubuntu:22.04
1+
FROM ubuntu:24.10
92

103
RUN apt-get update && apt-get install -y --no-install-recommends \
114
curl ca-certificates \

ci/linux-s390x.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ mkdir -m 777 /qemu
66
cd /qemu
77

88
curl --retry 5 -LO https://github.com/qemu/qemu/raw/HEAD/pc-bios/s390-ccw.img
9-
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20230607/images/generic/kernel.debian
10-
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20230607/images/generic/initrd.debian
9+
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20241227/images/generic/kernel.debian
10+
curl --retry 5 -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20241227/images/generic/initrd.debian
1111

1212
mv kernel.debian kernel
1313
mv initrd.debian initrd.gz

ci/linux-sparc64.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ set -eux
55
mkdir -m 777 /qemu
66
cd /qemu
77

8-
curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2022-12-09/debian-11.0.0-sparc64-NETINST-1.iso
9-
7z e debian-11.0.0-sparc64-NETINST-1.iso install/initrd.gz
10-
7z e debian-11.0.0-sparc64-NETINST-1.iso install/vmlinux
8+
curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2024-12-24/debian-12.0.0-sparc64-NETINST-1.iso
9+
7z e debian-12.0.0-sparc64-NETINST-1.iso install/initrd.gz
10+
7z e debian-12.0.0-sparc64-NETINST-1.iso install/vmlinux
1111
mv vmlinux kernel
12-
rm debian-11.0.0-sparc64-NETINST-1.iso
12+
rm debian-12.0.0-sparc64-NETINST-1.iso
1313

1414
mkdir init
1515
cd init

ci/run.sh

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ test_flags="--skip check_style"
8787
case "$target" in
8888
# Only run `libc-test`
8989
# FIXME(android): unit tests fail to start on Android
90-
# FIXME(s390x): unit tests fail to locate glibc
9190
*android*) cmd="$cmd --manifest-path libc-test/Cargo.toml" ;;
9291
*s390x*) cmd="$cmd --manifest-path libc-test/Cargo.toml" ;;
9392
# For all other platforms, test everything in the workspace

libc-test/build.rs

+34-1
Original file line numberDiff line numberDiff line change
@@ -4135,6 +4135,10 @@ fn test_linux(target: &str) {
41354135
// FIXME(linux): Requires >= 6.9 kernel headers.
41364136
"epoll_params" => true,
41374137

4138+
// FIXME(linux): Requires >= 6.12 kernel headers.
4139+
"dmabuf_cmsg" |
4140+
"dmabuf_token" => true,
4141+
41384142
_ => false,
41394143
}
41404144
});
@@ -4237,6 +4241,26 @@ fn test_linux(target: &str) {
42374241
{
42384242
return true;
42394243
}
4244+
// FIXME(musl): Not in musl yet
4245+
if name == "SO_NETNS_COOKIE"
4246+
|| name == "SO_BUF_LOCK"
4247+
|| name == "SO_RESERVE_MEM"
4248+
|| name == "SO_TXREHASH"
4249+
|| name == "SO_RCVMARK"
4250+
|| name == "SO_PASSPIDFD"
4251+
|| name == "SO_PEERPIDFD"
4252+
|| name == "SO_DEVMEM_LINEAR"
4253+
|| name == "SO_DEVMEM_DMABUF"
4254+
|| name == "SO_DEVMEM_DONTNEED"
4255+
{
4256+
return true;
4257+
}
4258+
// FIXME(musl): Not in musl yet
4259+
if name == "SCM_DEVMEM_LINEAR"
4260+
|| name == "SCM_DEVMEM_DMABUF"
4261+
{
4262+
return true;
4263+
}
42404264
}
42414265
match name {
42424266
// These constants are not available if gnu headers have been included
@@ -4255,7 +4279,9 @@ fn test_linux(target: &str) {
42554279
| "F_SEAL_SEAL"
42564280
| "F_SEAL_SHRINK"
42574281
| "F_SEAL_GROW"
4258-
| "F_SEAL_WRITE" => true,
4282+
| "F_SEAL_WRITE"
4283+
| "F_SEAL_FUTURE_WRITE"
4284+
| "F_SEAL_EXEC" => true,
42594285
// The `ARPHRD_CAN` is tested in the `linux_if_arp.rs` tests
42604286
// because including `linux/if_arp.h` causes some conflicts:
42614287
"ARPHRD_CAN" => true,
@@ -4534,6 +4560,13 @@ fn test_linux(target: &str) {
45344560
// FIXME(linux): Requires >= 6.12 kernel headers.
45354561
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
45364562

4563+
// FIXME(linux): Requires >= 6.12 kernel headers.
4564+
"SO_DEVMEM_LINEAR"
4565+
| "SO_DEVMEM_DMABUF"
4566+
| "SO_DEVMEM_DONTNEED"
4567+
| "SCM_DEVMEM_LINEAR"
4568+
| "SCM_DEVMEM_DMABUF" => true,
4569+
45374570
_ => false,
45384571
}
45394572
});

libc-test/semver/android.txt

+1
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ F_OFD_SETLK
685685
F_OFD_SETLKW
686686
F_OK
687687
F_RDLCK
688+
F_SEAL_EXEC
688689
F_SEAL_GROW
689690
F_SEAL_SEAL
690691
F_SEAL_SHRINK

libc-test/semver/linux.txt

+13
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ F_OFD_GETLK
864864
F_OFD_SETLK
865865
F_OFD_SETLKW
866866
F_RDLCK
867+
F_SEAL_EXEC
867868
F_SEAL_FUTURE_WRITE
868869
F_SEAL_GROW
869870
F_SEAL_SEAL
@@ -2647,6 +2648,8 @@ SCHED_OTHER
26472648
SCHED_RESET_ON_FORK
26482649
SCHED_RR
26492650
SCM_CREDENTIALS
2651+
SCM_DEVMEM_DMABUF
2652+
SCM_DEVMEM_LINEAR
26502653
SCM_J1939_DEST_ADDR
26512654
SCM_J1939_DEST_NAME
26522655
SCM_J1939_ERRQUEUE
@@ -2953,8 +2956,12 @@ SOL_X25
29532956
SOL_XDP
29542957
SOMAXCONN
29552958
SO_BINDTODEVICE
2959+
SO_BUF_LOCK
29562960
SO_BUSY_POLL
29572961
SO_BUSY_POLL_BUDGET
2962+
SO_DEVMEM_DMABUF
2963+
SO_DEVMEM_DONTNEED
2964+
SO_DEVMEM_LINEAR
29582965
SO_DOMAIN
29592966
SO_EE_OFFENDER
29602967
SO_EE_ORIGIN_ICMP
@@ -2968,20 +2975,26 @@ SO_J1939_FILTER
29682975
SO_J1939_PROMISC
29692976
SO_J1939_SEND_PRIO
29702977
SO_MARK
2978+
SO_NETNS_COOKIE
29712979
SO_ORIGINAL_DST
29722980
SO_PASSCRED
2981+
SO_PASSPIDFD
29732982
SO_PASSSEC
29742983
SO_PEEK_OFF
29752984
SO_PEERCRED
2985+
SO_PEERPIDFD
29762986
SO_PEERSEC
29772987
SO_PREFER_BUSY_POLL
29782988
SO_RCVBUFFORCE
2989+
SO_RCVMARK
2990+
SO_RESERVE_MEM
29792991
SO_REUSEPORT
29802992
SO_RXQ_OVFL
29812993
SO_SNDBUFFORCE
29822994
SO_TIMESTAMP
29832995
SO_TIMESTAMPING
29842996
SO_TIMESTAMPNS
2997+
SO_TXREHASH
29852998
SPLICE_F_GIFT
29862999
SPLICE_F_MORE
29873000
SPLICE_F_MOVE

src/unix/bsd/apple/mod.rs

+21
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,12 @@ s! {
13031303
pub ctl_id: u32,
13041304
pub ctl_name: [c_char; MAX_KCTL_NAME],
13051305
}
1306+
1307+
// sys/proc_info.h
1308+
pub struct proc_fdinfo {
1309+
pub proc_fd: i32,
1310+
pub proc_fdtype: u32,
1311+
}
13061312
}
13071313

13081314
s_no_extra_traits! {
@@ -5139,6 +5145,21 @@ pub const PROC_PIDTASKINFO: c_int = 4;
51395145
pub const PROC_PIDTHREADINFO: c_int = 5;
51405146
pub const PROC_PIDVNODEPATHINFO: c_int = 9;
51415147
pub const PROC_PIDPATHINFO_MAXSIZE: c_int = 4096;
5148+
5149+
pub const PROC_PIDLISTFDS: c_int = 1;
5150+
pub const PROC_PIDLISTFD_SIZE: c_int = mem::size_of::<proc_fdinfo>() as c_int;
5151+
pub const PROX_FDTYPE_ATALK: c_int = 0;
5152+
pub const PROX_FDTYPE_VNODE: c_int = 1;
5153+
pub const PROX_FDTYPE_SOCKET: c_int = 2;
5154+
pub const PROX_FDTYPE_PSHM: c_int = 3;
5155+
pub const PROX_FDTYPE_PSEM: c_int = 4;
5156+
pub const PROX_FDTYPE_KQUEUE: c_int = 5;
5157+
pub const PROX_FDTYPE_PIPE: c_int = 6;
5158+
pub const PROX_FDTYPE_FSEVENTS: c_int = 7;
5159+
pub const PROX_FDTYPE_NETPOLICY: c_int = 9;
5160+
pub const PROX_FDTYPE_CHANNEL: c_int = 10;
5161+
pub const PROX_FDTYPE_NEXUS: c_int = 11;
5162+
51425163
pub const PROC_CSM_ALL: c_uint = 0x0001;
51435164
pub const PROC_CSM_NOSMT: c_uint = 0x0002;
51445165
pub const PROC_CSM_TECS: c_uint = 0x0004;

src/unix/linux_like/android/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,7 @@ pub const F_TLOCK: c_int = 2;
13051305
pub const F_ULOCK: c_int = 0;
13061306

13071307
pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010;
1308+
pub const F_SEAL_EXEC: c_int = 0x0020;
13081309

13091310
pub const IFF_LOWER_UP: c_int = 0x10000;
13101311
pub const IFF_DORMANT: c_int = 0x20000;

src/unix/linux_like/linux/arch/generic/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ cfg_if! {
147147
}
148148
pub const SO_PREFER_BUSY_POLL: c_int = 69;
149149
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
150+
pub const SO_NETNS_COOKIE: c_int = 71;
151+
pub const SO_BUF_LOCK: c_int = 72;
152+
pub const SO_RESERVE_MEM: c_int = 73;
153+
pub const SO_TXREHASH: c_int = 74;
154+
pub const SO_RCVMARK: c_int = 75;
155+
pub const SO_PASSPIDFD: c_int = 76;
156+
pub const SO_PEERPIDFD: c_int = 77;
157+
pub const SO_DEVMEM_LINEAR: c_int = 78;
158+
pub const SO_DEVMEM_DMABUF: c_int = 79;
159+
pub const SO_DEVMEM_DONTNEED: c_int = 80;
150160

151161
cfg_if! {
152162
if #[cfg(any(
@@ -169,6 +179,9 @@ cfg_if! {
169179
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
170180
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;
171181

182+
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
183+
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
184+
172185
// Ioctl Constants
173186

174187
pub const TCGETS: Ioctl = 0x5401;

src/unix/linux_like/linux/arch/mips/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ cfg_if! {
120120
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
121121
pub const SO_PREFER_BUSY_POLL: c_int = 69;
122122
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
123+
pub const SO_NETNS_COOKIE: c_int = 71;
124+
pub const SO_BUF_LOCK: c_int = 72;
125+
pub const SO_RESERVE_MEM: c_int = 73;
126+
pub const SO_TXREHASH: c_int = 74;
127+
pub const SO_RCVMARK: c_int = 75;
128+
pub const SO_PASSPIDFD: c_int = 76;
129+
pub const SO_PEERPIDFD: c_int = 77;
130+
pub const SO_DEVMEM_LINEAR: c_int = 78;
131+
pub const SO_DEVMEM_DMABUF: c_int = 79;
132+
pub const SO_DEVMEM_DONTNEED: c_int = 80;
123133

124134
pub const FICLONE: c_ulong = 0x80049409;
125135
pub const FICLONERANGE: c_ulong = 0x8020940D;
@@ -129,6 +139,9 @@ pub const FICLONERANGE: c_ulong = 0x8020940D;
129139
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
130140
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;
131141

142+
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
143+
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
144+
132145
// Ioctl Constants
133146

134147
pub const TCGETS: Ioctl = 0x540d;

src/unix/linux_like/linux/arch/powerpc/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ const SO_SNDTIMEO_NEW: c_int = 67;
102102
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
103103
pub const SO_PREFER_BUSY_POLL: c_int = 69;
104104
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
105+
pub const SO_NETNS_COOKIE: c_int = 71;
106+
pub const SO_BUF_LOCK: c_int = 72;
107+
pub const SO_RESERVE_MEM: c_int = 73;
108+
pub const SO_TXREHASH: c_int = 74;
109+
pub const SO_RCVMARK: c_int = 75;
110+
pub const SO_PASSPIDFD: c_int = 76;
111+
pub const SO_PEERPIDFD: c_int = 77;
112+
pub const SO_DEVMEM_LINEAR: c_int = 78;
113+
pub const SO_DEVMEM_DMABUF: c_int = 79;
114+
pub const SO_DEVMEM_DONTNEED: c_int = 80;
105115

106116
pub const FICLONE: c_ulong = 0x80049409;
107117
pub const FICLONERANGE: c_ulong = 0x8020940D;
@@ -111,6 +121,9 @@ pub const FICLONERANGE: c_ulong = 0x8020940D;
111121
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
112122
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;
113123

124+
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
125+
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
126+
114127
// Ioctl Constants
115128

116129
cfg_if! {

src/unix/linux_like/linux/arch/sparc/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,25 @@ pub const SO_TIMESTAMPING: c_int = 0x0023;
9797
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 0x0047;
9898
pub const SO_PREFER_BUSY_POLL: c_int = 0x0048;
9999
pub const SO_BUSY_POLL_BUDGET: c_int = 0x0049;
100+
pub const SO_NETNS_COOKIE: c_int = 0x0050;
101+
pub const SO_BUF_LOCK: c_int = 0x0051;
102+
pub const SO_RESERVE_MEM: c_int = 0x0052;
103+
pub const SO_TXREHASH: c_int = 0x0053;
104+
pub const SO_RCVMARK: c_int = 0x0054;
105+
pub const SO_PASSPIDFD: c_int = 0x0055;
106+
pub const SO_PEERPIDFD: c_int = 0x0056;
107+
pub const SO_DEVMEM_LINEAR: c_int = 0x0057;
108+
pub const SO_DEVMEM_DMABUF: c_int = 0x0058;
109+
pub const SO_DEVMEM_DONTNEED: c_int = 0x0059;
100110

101111
// Defined in unix/linux_like/mod.rs
102112
// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP;
103113
pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS;
104114
pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING;
105115

116+
pub const SCM_DEVMEM_LINEAR: c_int = SO_DEVMEM_LINEAR;
117+
pub const SCM_DEVMEM_DMABUF: c_int = SO_DEVMEM_DMABUF;
118+
106119
// Ioctl Constants
107120

108121
pub const TCGETS: Ioctl = 0x40245408;

src/unix/linux_like/linux/gnu/b64/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ s! {
7777
target_arch = "mips64r6",
7878
target_arch = "powerpc64",
7979
target_arch = "riscv64",
80-
target_arch = "sparc64"
80+
target_arch = "sparc64",
81+
target_arch = "s390x",
8182
)))]
8283
__reserved: crate::__syscall_ulong_t,
8384
pub sem_ctime: crate::time_t,
@@ -88,7 +89,8 @@ s! {
8889
target_arch = "mips64r6",
8990
target_arch = "powerpc64",
9091
target_arch = "riscv64",
91-
target_arch = "sparc64"
92+
target_arch = "sparc64",
93+
target_arch = "s390x",
9294
)))]
9395
__reserved2: crate::__syscall_ulong_t,
9496
pub sem_nsems: crate::__syscall_ulong_t,

src/unix/linux_like/linux/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,21 @@ s! {
13201320
pub propagation: crate::__u64,
13211321
pub userns_fd: crate::__u64,
13221322
}
1323+
1324+
// linux/uio.h
1325+
1326+
pub struct dmabuf_cmsg {
1327+
pub frag_offset: crate::__u64,
1328+
pub frag_size: crate::__u32,
1329+
pub frag_token: crate::__u32,
1330+
pub dmabuf_id: crate::__u32,
1331+
pub flags: crate::__u32,
1332+
}
1333+
1334+
pub struct dmabuf_token {
1335+
pub token_start: crate::__u32,
1336+
pub token_count: crate::__u32,
1337+
}
13231338
}
13241339

13251340
cfg_if! {
@@ -2770,6 +2785,7 @@ pub const F_TLOCK: c_int = 2;
27702785
pub const F_ULOCK: c_int = 0;
27712786

27722787
pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010;
2788+
pub const F_SEAL_EXEC: c_int = 0x0020;
27732789

27742790
pub const IFF_LOWER_UP: c_int = 0x10000;
27752791
pub const IFF_DORMANT: c_int = 0x20000;

0 commit comments

Comments
 (0)