diff --git a/README.md b/README.md index c25b0cb..ed0e96f 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ See also [setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-t | libc | GCC | clang | C++ | test | host | | ---- | --- | ----- | --- | ---- | ---- | -| uClibc-ng 1.0.34 | 10.2.0 | host | ✓ (libstdc++) | ✓ (qemu) | x86_64 Linux (glibc 2.17+) | +| uClibc-ng 1.0.45 | 13.2.0 | host | ✓ (libstdc++) | ✓ (qemu) | x86_64 Linux (glibc 2.17+) | ([Dockerfile](docker/linux-uclibc.Dockerfile)) diff --git a/docker/dragonfly.Dockerfile b/docker/dragonfly.Dockerfile index 921bd9c..61997a5 100644 --- a/docker/dragonfly.Dockerfile +++ b/docker/dragonfly.Dockerfile @@ -10,8 +10,9 @@ FROM ghcr.io/taiki-e/downloader as sysroot SHELL ["/bin/bash", "-eEuxo", "pipefail", "-c"] ARG DRAGONFLY_VERSION RUN mkdir -p /sysroot -# https://mirror-master.dragonflybsd.org/iso-images -RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-${DRAGONFLY_VERSION}_REL.iso.bz2" \ +# https://mirror-master.dragonflybsd.org/iso-images's certificate has expired... +# https://cdimage.debian.org/mirror/dragonflybsd.org/iso-images +RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://cdimage.debian.org/mirror/dragonflybsd.org/iso-images/dfly-x86_64-${DRAGONFLY_VERSION}_REL.iso.bz2" \ | bsdtar xjf - -C /sysroot ./lib ./usr/include ./usr/lib FROM ghcr.io/taiki-e/build-base:ubuntu-"${UBUNTU_VERSION}" as builder diff --git a/docker/linux-uclibc.Dockerfile b/docker/linux-uclibc.Dockerfile index b97a230..a3a3e0f 100644 --- a/docker/linux-uclibc.Dockerfile +++ b/docker/linux-uclibc.Dockerfile @@ -8,11 +8,10 @@ ARG UBUNTU_VERSION=20.04 -# TODO: update to 2021.11-1 or 2022.08-1 # https://toolchains.bootlin.com/toolchains.html -# GCC 10.2.0, GDB 9.2, Linux headers 5.4.61, uClibc 1.0.34, binutils 2.34 -ARG TOOLCHAIN_VERSION=2020.08-1 -ARG GCC_VERSION=10.2.0 +# GCC 13.2.0, GDB 14.1, Linux headers 5.15.149, uClibc 1.0.45, binutils 2.42 +ARG TOOLCHAIN_VERSION=2024.02-1 +ARG GCC_VERSION=13.2.0 FROM ghcr.io/taiki-e/downloader as toolchain SHELL ["/bin/bash", "-eEuxo", "pipefail", "-c"] diff --git a/docker/test-base/patches/compiler_builtins+m68k-unknown-linux-gnu.diff b/docker/test-base/patches/compiler_builtins+m68k-unknown-linux-gnu.diff new file mode 100644 index 0000000..c96ffd4 --- /dev/null +++ b/docker/test-base/patches/compiler_builtins+m68k-unknown-linux-gnu.diff @@ -0,0 +1,12 @@ +diff --git a/src/mem/mod.rs b/src/mem/mod.rs +index ccf1917..dcbbf52 100644 +--- a/src/mem/mod.rs ++++ b/src/mem/mod.rs +@@ -130,6 +130,7 @@ fn memset_element_unordered_atomic(s: *mut T, c: u8, bytes: usize) + } + } + ++#[cfg(not(target_arch = "m68k"))] + intrinsics! { + #[cfg(target_has_atomic_load_store = "8")] + pub unsafe extern "C" fn __llvm_memcpy_element_unordered_atomic_1(dest: *mut u8, src: *const u8, bytes: usize) -> () { diff --git a/docker/test-base/patches/libc+armv5te-unknown-linux-uclibceabi.diff b/docker/test-base/patches/libc+armv5te-unknown-linux-uclibceabi.diff index 92ed8bb..87a1e0e 100644 --- a/docker/test-base/patches/libc+armv5te-unknown-linux-uclibceabi.diff +++ b/docker/test-base/patches/libc+armv5te-unknown-linux-uclibceabi.diff @@ -1,70 +1,70 @@ diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs -index 4afb98e95..67d5ba1b3 100644 +index 48b03e9ee..3df2f7b3c 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -107,6 +107,68 @@ struct siginfo_si_value { } } -+cfg_if! { -+ if #[cfg(libc_union)] { -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ struct sifields_sigchld { -+ si_pid: ::pid_t, -+ si_uid: ::uid_t, -+ si_status: ::c_int, -+ si_utime: ::c_long, -+ si_stime: ::c_long, -+ } -+ impl ::Copy for sifields_sigchld {} -+ impl ::Clone for sifields_sigchld { -+ fn clone(&self) -> sifields_sigchld { -+ *self -+ } -+ } ++extern "C" { ++ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: ::pid_t, ++ si_uid: ::uid_t, ++ si_status: ::c_int, ++ si_utime: ::c_long, ++ si_stime: ::c_long, ++} ++impl ::Copy for sifields_sigchld {} ++impl ::Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} + -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ union sifields { -+ _align_pointer: *mut ::c_void, -+ sigchld: sifields_sigchld, -+ } ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut ::c_void, ++ sigchld: sifields_sigchld, ++} + -+ // Internal, for casts to access union fields. Note that some variants -+ // of sifields start with a pointer, which makes the alignment of -+ // sifields vary on 32-bit and 64-bit architectures. -+ #[repr(C)] -+ struct siginfo_f { -+ _siginfo_base: [::c_int; 3], -+ sifields: sifields, -+ } ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [::c_int; 3], ++ sifields: sifields, ++} + -+ impl siginfo_t { -+ unsafe fn sifields(&self) -> &sifields { -+ &(*(self as *const siginfo_t as *const siginfo_f)).sifields -+ } ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } + -+ pub unsafe fn si_pid(&self) -> ::pid_t { -+ self.sifields().sigchld.si_pid -+ } ++ pub unsafe fn si_pid(&self) -> ::pid_t { ++ self.sifields().sigchld.si_pid ++ } + -+ pub unsafe fn si_uid(&self) -> ::uid_t { -+ self.sifields().sigchld.si_uid -+ } ++ pub unsafe fn si_uid(&self) -> ::uid_t { ++ self.sifields().sigchld.si_uid ++ } + -+ pub unsafe fn si_status(&self) -> ::c_int { -+ self.sifields().sigchld.si_status -+ } ++ pub unsafe fn si_status(&self) -> ::c_int { ++ self.sifields().sigchld.si_status ++ } + -+ pub unsafe fn si_utime(&self) -> ::c_long { -+ self.sifields().sigchld.si_utime -+ } ++ pub unsafe fn si_utime(&self) -> ::c_long { ++ self.sifields().sigchld.si_utime ++ } + -+ pub unsafe fn si_stime(&self) -> ::c_long { -+ self.sifields().sigchld.si_stime -+ } -+ } ++ pub unsafe fn si_stime(&self) -> ::c_long { ++ self.sifields().sigchld.si_stime + } +} + diff --git a/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabi.diff b/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabi.diff index 92ed8bb..87a1e0e 100644 --- a/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabi.diff +++ b/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabi.diff @@ -1,70 +1,70 @@ diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs -index 4afb98e95..67d5ba1b3 100644 +index 48b03e9ee..3df2f7b3c 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -107,6 +107,68 @@ struct siginfo_si_value { } } -+cfg_if! { -+ if #[cfg(libc_union)] { -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ struct sifields_sigchld { -+ si_pid: ::pid_t, -+ si_uid: ::uid_t, -+ si_status: ::c_int, -+ si_utime: ::c_long, -+ si_stime: ::c_long, -+ } -+ impl ::Copy for sifields_sigchld {} -+ impl ::Clone for sifields_sigchld { -+ fn clone(&self) -> sifields_sigchld { -+ *self -+ } -+ } ++extern "C" { ++ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: ::pid_t, ++ si_uid: ::uid_t, ++ si_status: ::c_int, ++ si_utime: ::c_long, ++ si_stime: ::c_long, ++} ++impl ::Copy for sifields_sigchld {} ++impl ::Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} + -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ union sifields { -+ _align_pointer: *mut ::c_void, -+ sigchld: sifields_sigchld, -+ } ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut ::c_void, ++ sigchld: sifields_sigchld, ++} + -+ // Internal, for casts to access union fields. Note that some variants -+ // of sifields start with a pointer, which makes the alignment of -+ // sifields vary on 32-bit and 64-bit architectures. -+ #[repr(C)] -+ struct siginfo_f { -+ _siginfo_base: [::c_int; 3], -+ sifields: sifields, -+ } ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [::c_int; 3], ++ sifields: sifields, ++} + -+ impl siginfo_t { -+ unsafe fn sifields(&self) -> &sifields { -+ &(*(self as *const siginfo_t as *const siginfo_f)).sifields -+ } ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } + -+ pub unsafe fn si_pid(&self) -> ::pid_t { -+ self.sifields().sigchld.si_pid -+ } ++ pub unsafe fn si_pid(&self) -> ::pid_t { ++ self.sifields().sigchld.si_pid ++ } + -+ pub unsafe fn si_uid(&self) -> ::uid_t { -+ self.sifields().sigchld.si_uid -+ } ++ pub unsafe fn si_uid(&self) -> ::uid_t { ++ self.sifields().sigchld.si_uid ++ } + -+ pub unsafe fn si_status(&self) -> ::c_int { -+ self.sifields().sigchld.si_status -+ } ++ pub unsafe fn si_status(&self) -> ::c_int { ++ self.sifields().sigchld.si_status ++ } + -+ pub unsafe fn si_utime(&self) -> ::c_long { -+ self.sifields().sigchld.si_utime -+ } ++ pub unsafe fn si_utime(&self) -> ::c_long { ++ self.sifields().sigchld.si_utime ++ } + -+ pub unsafe fn si_stime(&self) -> ::c_long { -+ self.sifields().sigchld.si_stime -+ } -+ } ++ pub unsafe fn si_stime(&self) -> ::c_long { ++ self.sifields().sigchld.si_stime + } +} + diff --git a/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabihf.diff b/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabihf.diff index 92ed8bb..87a1e0e 100644 --- a/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabihf.diff +++ b/docker/test-base/patches/libc+armv7-unknown-linux-uclibceabihf.diff @@ -1,70 +1,70 @@ diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs -index 4afb98e95..67d5ba1b3 100644 +index 48b03e9ee..3df2f7b3c 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -107,6 +107,68 @@ struct siginfo_si_value { } } -+cfg_if! { -+ if #[cfg(libc_union)] { -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ struct sifields_sigchld { -+ si_pid: ::pid_t, -+ si_uid: ::uid_t, -+ si_status: ::c_int, -+ si_utime: ::c_long, -+ si_stime: ::c_long, -+ } -+ impl ::Copy for sifields_sigchld {} -+ impl ::Clone for sifields_sigchld { -+ fn clone(&self) -> sifields_sigchld { -+ *self -+ } -+ } ++extern "C" { ++ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: ::pid_t, ++ si_uid: ::uid_t, ++ si_status: ::c_int, ++ si_utime: ::c_long, ++ si_stime: ::c_long, ++} ++impl ::Copy for sifields_sigchld {} ++impl ::Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} + -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ union sifields { -+ _align_pointer: *mut ::c_void, -+ sigchld: sifields_sigchld, -+ } ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut ::c_void, ++ sigchld: sifields_sigchld, ++} + -+ // Internal, for casts to access union fields. Note that some variants -+ // of sifields start with a pointer, which makes the alignment of -+ // sifields vary on 32-bit and 64-bit architectures. -+ #[repr(C)] -+ struct siginfo_f { -+ _siginfo_base: [::c_int; 3], -+ sifields: sifields, -+ } ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [::c_int; 3], ++ sifields: sifields, ++} + -+ impl siginfo_t { -+ unsafe fn sifields(&self) -> &sifields { -+ &(*(self as *const siginfo_t as *const siginfo_f)).sifields -+ } ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } + -+ pub unsafe fn si_pid(&self) -> ::pid_t { -+ self.sifields().sigchld.si_pid -+ } ++ pub unsafe fn si_pid(&self) -> ::pid_t { ++ self.sifields().sigchld.si_pid ++ } + -+ pub unsafe fn si_uid(&self) -> ::uid_t { -+ self.sifields().sigchld.si_uid -+ } ++ pub unsafe fn si_uid(&self) -> ::uid_t { ++ self.sifields().sigchld.si_uid ++ } + -+ pub unsafe fn si_status(&self) -> ::c_int { -+ self.sifields().sigchld.si_status -+ } ++ pub unsafe fn si_status(&self) -> ::c_int { ++ self.sifields().sigchld.si_status ++ } + -+ pub unsafe fn si_utime(&self) -> ::c_long { -+ self.sifields().sigchld.si_utime -+ } ++ pub unsafe fn si_utime(&self) -> ::c_long { ++ self.sifields().sigchld.si_utime ++ } + -+ pub unsafe fn si_stime(&self) -> ::c_long { -+ self.sifields().sigchld.si_stime -+ } -+ } ++ pub unsafe fn si_stime(&self) -> ::c_long { ++ self.sifields().sigchld.si_stime + } +} + diff --git a/docker/test-base/patches/libc+mips-unknown-linux-uclibc.diff b/docker/test-base/patches/libc+mips-unknown-linux-uclibc.diff index 92ed8bb..87a1e0e 100644 --- a/docker/test-base/patches/libc+mips-unknown-linux-uclibc.diff +++ b/docker/test-base/patches/libc+mips-unknown-linux-uclibc.diff @@ -1,70 +1,70 @@ diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs -index 4afb98e95..67d5ba1b3 100644 +index 48b03e9ee..3df2f7b3c 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -107,6 +107,68 @@ struct siginfo_si_value { } } -+cfg_if! { -+ if #[cfg(libc_union)] { -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ struct sifields_sigchld { -+ si_pid: ::pid_t, -+ si_uid: ::uid_t, -+ si_status: ::c_int, -+ si_utime: ::c_long, -+ si_stime: ::c_long, -+ } -+ impl ::Copy for sifields_sigchld {} -+ impl ::Clone for sifields_sigchld { -+ fn clone(&self) -> sifields_sigchld { -+ *self -+ } -+ } ++extern "C" { ++ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: ::pid_t, ++ si_uid: ::uid_t, ++ si_status: ::c_int, ++ si_utime: ::c_long, ++ si_stime: ::c_long, ++} ++impl ::Copy for sifields_sigchld {} ++impl ::Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} + -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ union sifields { -+ _align_pointer: *mut ::c_void, -+ sigchld: sifields_sigchld, -+ } ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut ::c_void, ++ sigchld: sifields_sigchld, ++} + -+ // Internal, for casts to access union fields. Note that some variants -+ // of sifields start with a pointer, which makes the alignment of -+ // sifields vary on 32-bit and 64-bit architectures. -+ #[repr(C)] -+ struct siginfo_f { -+ _siginfo_base: [::c_int; 3], -+ sifields: sifields, -+ } ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [::c_int; 3], ++ sifields: sifields, ++} + -+ impl siginfo_t { -+ unsafe fn sifields(&self) -> &sifields { -+ &(*(self as *const siginfo_t as *const siginfo_f)).sifields -+ } ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } + -+ pub unsafe fn si_pid(&self) -> ::pid_t { -+ self.sifields().sigchld.si_pid -+ } ++ pub unsafe fn si_pid(&self) -> ::pid_t { ++ self.sifields().sigchld.si_pid ++ } + -+ pub unsafe fn si_uid(&self) -> ::uid_t { -+ self.sifields().sigchld.si_uid -+ } ++ pub unsafe fn si_uid(&self) -> ::uid_t { ++ self.sifields().sigchld.si_uid ++ } + -+ pub unsafe fn si_status(&self) -> ::c_int { -+ self.sifields().sigchld.si_status -+ } ++ pub unsafe fn si_status(&self) -> ::c_int { ++ self.sifields().sigchld.si_status ++ } + -+ pub unsafe fn si_utime(&self) -> ::c_long { -+ self.sifields().sigchld.si_utime -+ } ++ pub unsafe fn si_utime(&self) -> ::c_long { ++ self.sifields().sigchld.si_utime ++ } + -+ pub unsafe fn si_stime(&self) -> ::c_long { -+ self.sifields().sigchld.si_stime -+ } -+ } ++ pub unsafe fn si_stime(&self) -> ::c_long { ++ self.sifields().sigchld.si_stime + } +} + diff --git a/docker/test-base/patches/libc+mipsel-unknown-linux-uclibc.diff b/docker/test-base/patches/libc+mipsel-unknown-linux-uclibc.diff index 92ed8bb..87a1e0e 100644 --- a/docker/test-base/patches/libc+mipsel-unknown-linux-uclibc.diff +++ b/docker/test-base/patches/libc+mipsel-unknown-linux-uclibc.diff @@ -1,70 +1,70 @@ diff --git a/src/unix/linux_like/linux/uclibc/mod.rs b/src/unix/linux_like/linux/uclibc/mod.rs -index 4afb98e95..67d5ba1b3 100644 +index 48b03e9ee..3df2f7b3c 100644 --- a/src/unix/linux_like/linux/uclibc/mod.rs +++ b/src/unix/linux_like/linux/uclibc/mod.rs @@ -107,6 +107,68 @@ struct siginfo_si_value { } } -+cfg_if! { -+ if #[cfg(libc_union)] { -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ struct sifields_sigchld { -+ si_pid: ::pid_t, -+ si_uid: ::uid_t, -+ si_status: ::c_int, -+ si_utime: ::c_long, -+ si_stime: ::c_long, -+ } -+ impl ::Copy for sifields_sigchld {} -+ impl ::Clone for sifields_sigchld { -+ fn clone(&self) -> sifields_sigchld { -+ *self -+ } -+ } ++extern "C" { ++ pub fn getauxval(type_: ::c_ulong) -> ::c_ulong; ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: ::pid_t, ++ si_uid: ::uid_t, ++ si_status: ::c_int, ++ si_utime: ::c_long, ++ si_stime: ::c_long, ++} ++impl ::Copy for sifields_sigchld {} ++impl ::Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} + -+ // Internal, for casts to access union fields -+ #[repr(C)] -+ union sifields { -+ _align_pointer: *mut ::c_void, -+ sigchld: sifields_sigchld, -+ } ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut ::c_void, ++ sigchld: sifields_sigchld, ++} + -+ // Internal, for casts to access union fields. Note that some variants -+ // of sifields start with a pointer, which makes the alignment of -+ // sifields vary on 32-bit and 64-bit architectures. -+ #[repr(C)] -+ struct siginfo_f { -+ _siginfo_base: [::c_int; 3], -+ sifields: sifields, -+ } ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [::c_int; 3], ++ sifields: sifields, ++} + -+ impl siginfo_t { -+ unsafe fn sifields(&self) -> &sifields { -+ &(*(self as *const siginfo_t as *const siginfo_f)).sifields -+ } ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } + -+ pub unsafe fn si_pid(&self) -> ::pid_t { -+ self.sifields().sigchld.si_pid -+ } ++ pub unsafe fn si_pid(&self) -> ::pid_t { ++ self.sifields().sigchld.si_pid ++ } + -+ pub unsafe fn si_uid(&self) -> ::uid_t { -+ self.sifields().sigchld.si_uid -+ } ++ pub unsafe fn si_uid(&self) -> ::uid_t { ++ self.sifields().sigchld.si_uid ++ } + -+ pub unsafe fn si_status(&self) -> ::c_int { -+ self.sifields().sigchld.si_status -+ } ++ pub unsafe fn si_status(&self) -> ::c_int { ++ self.sifields().sigchld.si_status ++ } + -+ pub unsafe fn si_utime(&self) -> ::c_long { -+ self.sifields().sigchld.si_utime -+ } ++ pub unsafe fn si_utime(&self) -> ::c_long { ++ self.sifields().sigchld.si_utime ++ } + -+ pub unsafe fn si_stime(&self) -> ::c_long { -+ self.sifields().sigchld.si_stime -+ } -+ } ++ pub unsafe fn si_stime(&self) -> ::c_long { ++ self.sifields().sigchld.si_stime + } +} + diff --git a/docker/test-base/patches/libc+x86_64-unknown-dragonfly.diff b/docker/test-base/patches/libc+x86_64-unknown-dragonfly.diff new file mode 100644 index 0000000..6dee02e --- /dev/null +++ b/docker/test-base/patches/libc+x86_64-unknown-dragonfly.diff @@ -0,0 +1,81 @@ +diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt +index 8135be3b4..febed0b3a 100644 +--- a/libc-test/semver/dragonfly.txt ++++ b/libc-test/semver/dragonfly.txt +@@ -326,6 +326,9 @@ GLOB_NOESCAPE + GLOB_NOMATCH + GLOB_NOSORT + GLOB_NOSPACE ++GRND_INSECURE ++GRND_NONBLOCK ++GRND_RANDOM + HW_BYTEORDER + HW_DISKNAMES + HW_DISKSTATS +@@ -1308,6 +1311,7 @@ fstatfs + futimes + getdomainname + getdtablesize ++getentropy + getgrent + getgrent_r + getgrgid +@@ -1331,6 +1335,7 @@ getprogname + getpwent + getpwent_r + getpwnam_r ++getrandom + getresgid + getresuid + getrlimit +diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs +index 78314084c..195c6cb3e 100644 +--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs ++++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs +@@ -3875,11 +3875,6 @@ fn clone(&self) -> dot3Vendors { + // for use with fspacectl + pub const SPACECTL_DEALLOC: ::c_int = 1; + +-// For getrandom() +-pub const GRND_NONBLOCK: ::c_uint = 0x1; +-pub const GRND_RANDOM: ::c_uint = 0x2; +-pub const GRND_INSECURE: ::c_uint = 0x4; +- + // For realhostname* api + pub const HOSTNAME_FOUND: ::c_int = 0; + pub const HOSTNAME_INCORRECTNAME: ::c_int = 1; +@@ -5393,8 +5388,6 @@ pub fn shm_rename( + + pub fn fdatasync(fd: ::c_int) -> ::c_int; + +- pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; +- pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int; + pub fn setproctitle_fast(fmt: *const ::c_char, ...); + pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int; +diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs +index 00a944e42..9b555e42e 100644 +--- a/src/unix/bsd/freebsdlike/mod.rs ++++ b/src/unix/bsd/freebsdlike/mod.rs +@@ -1456,6 +1456,11 @@ fn hash(&self, state: &mut H) { + pub const RB_MUTE: ::c_int = 0x10000; + pub const RB_SELFTEST: ::c_int = 0x20000; + ++// For getrandom() ++pub const GRND_NONBLOCK: ::c_uint = 0x1; ++pub const GRND_RANDOM: ::c_uint = 0x2; ++pub const GRND_INSECURE: ::c_uint = 0x4; ++ + safe_f! { + pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { + status == 0x13 +@@ -1829,6 +1834,9 @@ pub fn mq_timedsend( + abs_timeout: *const ::timespec, + ) -> ::c_int; + pub fn mq_unlink(name: *const ::c_char) -> ::c_int; ++ ++ pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t; ++ pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; + } + + #[link(name = "util")] diff --git a/platform-support-status-tier3.md b/platform-support-status-tier3.md index 709c863..19e3812 100644 --- a/platform-support-status-tier3.md +++ b/platform-support-status-tier3.md @@ -75,7 +75,7 @@ See [platform-support-status.md](platform-support-status.md) for Tier 1 & Tier 2 - [ ] i686-win7-windows-msvc - [ ] i686-wrs-vxworks - [ ] loongarch64-unknown-linux-musl -- [ ] m68k-unknown-linux-gnu +- [x] m68k-unknown-linux-gnu - [x] mips-unknown-linux-gnu - [x] mips-unknown-linux-musl - [x] mips-unknown-linux-uclibc diff --git a/tools/target-list-shared.sh b/tools/target-list-shared.sh index 7863f76..c883b24 100644 --- a/tools/target-list-shared.sh +++ b/tools/target-list-shared.sh @@ -21,7 +21,7 @@ linux_gnu_targets=( i586-unknown-linux-gnu i686-unknown-linux-gnu loongarch64-unknown-linux-gnu - # m68k-unknown-linux-gnu # tier3, build fail: https://github.com/rust-lang/rust/issues/89498 + m68k-unknown-linux-gnu # tier3, build fail: https://github.com/rust-lang/rust/issues/89498 mips-unknown-linux-gnu # tier3 mips64-unknown-linux-gnuabi64 # tier3 mips64el-unknown-linux-gnuabi64 # tier3