diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile index 0aa99eeea10ae..b009e95b0e71e 100644 --- a/ci/docker/aarch64-linux-android/Dockerfile +++ b/ci/docker/aarch64-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN dpkg --add-architecture i386 RUN apt-get update diff --git a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index 0588b4643a9e4..a609d8a3b7a28 100644 --- a/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates \ gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user diff --git a/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/ci/docker/aarch64-unknown-linux-musl/Dockerfile index fa00395125ff9..2002879e8c9e0 100644 --- a/ci/docker/aarch64-unknown-linux-musl/Dockerfile +++ b/ci/docker/aarch64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile index e5cc79d87fd1b..93d850b38eb1f 100644 --- a/ci/docker/arm-linux-androideabi/Dockerfile +++ b/ci/docker/arm-linux-androideabi/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN dpkg --add-architecture i386 RUN apt-get update diff --git a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile index 299ff9719fd57..57efe887b6292 100644 --- a/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates \ gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user diff --git a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile index f7d9ec53bdcc0..53228f46e6cef 100644 --- a/ci/docker/arm-unknown-linux-musleabihf/Dockerfile +++ b/ci/docker/arm-unknown-linux-musleabihf/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile index 4f94531d9f150..e6be22c93c637 100644 --- a/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-arm curl \ diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile index bf41bfa9a3efb..65d1a949ec577 100644 --- a/ci/docker/asmjs-unknown-emscripten/Dockerfile +++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 # This is a workaround to avoid the interaction with tzdata. ENV DEBIAN_FRONTEND=noninteractive @@ -15,7 +15,8 @@ RUN apt-get install -y --no-install-recommends \ libxml2 \ python3 \ python3-distutils \ - xz-utils + xz-utils \ + bzip2 COPY emscripten.sh / RUN bash /emscripten.sh diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile index 62a379b3cf8bc..ed1b2e9fbef0e 100644 --- a/ci/docker/i686-linux-android/Dockerfile +++ b/ci/docker/i686-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN dpkg --add-architecture i386 RUN apt-get update diff --git a/ci/docker/i686-unknown-linux-gnu/Dockerfile b/ci/docker/i686-unknown-linux-gnu/Dockerfile index 6bab1d0c64fab..bbe76a4c5c16c 100644 --- a/ci/docker/i686-unknown-linux-gnu/Dockerfile +++ b/ci/docker/i686-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc-multilib libc6-dev ca-certificates diff --git a/ci/docker/i686-unknown-linux-musl/Dockerfile b/ci/docker/i686-unknown-linux-musl/Dockerfile index f168be993cae0..fd2ba4c63b166 100644 --- a/ci/docker/i686-unknown-linux-musl/Dockerfile +++ b/ci/docker/i686-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN dpkg --add-architecture i386 RUN apt-get update diff --git a/ci/docker/mips-unknown-linux-gnu/Dockerfile b/ci/docker/mips-unknown-linux-gnu/Dockerfile index 574f184673fdc..333a5bae32a9d 100644 --- a/ci/docker/mips-unknown-linux-gnu/Dockerfile +++ b/ci/docker/mips-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/mips-unknown-linux-musl/Dockerfile b/ci/docker/mips-unknown-linux-musl/Dockerfile index a078c1bd72946..6fbd284fb9ba3 100644 --- a/ci/docker/mips-unknown-linux-musl/Dockerfile +++ b/ci/docker/mips-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \ diff --git a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile index 83a52d87ac8fa..263a2a77d5501 100644 --- a/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile +++ b/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile b/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile index 2d34919c7a36e..9e36b3b7f7f25 100644 --- a/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile +++ b/ci/docker/mips64-unknown-linux-muslabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile index 2ba6b2526916a..49fd75cb04f38 100644 --- a/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile +++ b/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile b/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile index 2960729c1836b..c8b6f122a5f23 100644 --- a/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile +++ b/ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/ci/docker/mipsel-unknown-linux-musl/Dockerfile index 16ddd0baf8deb..dad215abf5601 100644 --- a/ci/docker/mipsel-unknown-linux-musl/Dockerfile +++ b/ci/docker/mipsel-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \ diff --git a/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile b/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile index 5abb49dbe6681..fe9806d0535b8 100644 --- a/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile +++ b/ci/docker/mipsel-unknown-linux-uclibc/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \ diff --git a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index 2298b964b9ffb..50edc7d97dda9 100644 --- a/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index dcafec95fff6f..d04283615507a 100644 --- a/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index bfcd268a0b9f9..52e1874ff3b89 100644 --- a/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile index 2ab35b317f96b..7102e605668e4 100644 --- a/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile +++ b/ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/ci/docker/s390x-unknown-linux-gnu/Dockerfile index b26252a00f6a4..73d158dbcf9e6 100644 --- a/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/ci/docker/s390x-unknown-linux-musl/Dockerfile b/ci/docker/s390x-unknown-linux-musl/Dockerfile index b602920780180..ba6331e761001 100644 --- a/ci/docker/s390x-unknown-linux-musl/Dockerfile +++ b/ci/docker/s390x-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile index 6dabc8c563962..d45e56195dede 100644 --- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile @@ -1,3 +1,4 @@ +# FIXME: Update to 22.04 once Debian image of sparc64 has a newer glibc. FROM ubuntu:20.04 RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/ci/docker/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile index 999b28c83c2a8..5a10efe16eb12 100644 --- a/ci/docker/wasm32-unknown-emscripten/Dockerfile +++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 # This is a workaround to avoid the interaction with tzdata. ENV DEBIAN_FRONTEND=noninteractive @@ -21,7 +21,8 @@ RUN apt-get install -y --no-install-recommends \ cmake \ sudo \ gdb \ - xz-utils + xz-utils \ + bzip2 RUN ln -s /usr/bin/python3 /usr/bin/python & \ ln -s /usr/bin/pip3 /usr/bin/pip diff --git a/ci/docker/wasm32-wasi/Dockerfile b/ci/docker/wasm32-wasi/Dockerfile index 874bdc3be4a8d..ffc4b4bdea079 100644 --- a/ci/docker/wasm32-wasi/Dockerfile +++ b/ci/docker/wasm32-wasi/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/ci/docker/x86_64-linux-android/Dockerfile b/ci/docker/x86_64-linux-android/Dockerfile index a814edda6cdea..bbce3b9a6bc8f 100644 --- a/ci/docker/x86_64-linux-android/Dockerfile +++ b/ci/docker/x86_64-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile index 5eb1ad082316c..f8e6be479470b 100644 --- a/ci/docker/x86_64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates linux-headers-generic diff --git a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile index 6bab1d0c64fab..bbe76a4c5c16c 100644 --- a/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ gcc-multilib libc6-dev ca-certificates diff --git a/ci/docker/x86_64-unknown-linux-musl/Dockerfile b/ci/docker/x86_64-unknown-linux-musl/Dockerfile index ad4ad8f5b1a75..0495007640004 100644 --- a/ci/docker/x86_64-unknown-linux-musl/Dockerfile +++ b/ci/docker/x86_64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ diff --git a/ci/emscripten.sh b/ci/emscripten.sh index c16e793bb4e1f..967b586b5f199 100644 --- a/ci/emscripten.sh +++ b/ci/emscripten.sh @@ -2,34 +2,19 @@ set -ex -EMSDK_VERSION=1.39.20 - -hide_output() { - set +x - on_err=" -echo ERROR: An error was encountered with the build. -cat /tmp/build.log -exit 1 -" - trap '$on_err' ERR - bash -c "while true; do sleep 30; echo \$(date) - building ...; done" & - PING_LOOP_PID=$! - "${@}" &> /tmp/build.log - trap - ERR - kill $PING_LOOP_PID - rm -f /tmp/build.log - set -x -} +# FIXME: 3.1.21 removed a lot of header files (https://github.com/emscripten-core/emscripten/pull/17704). +# We have to tweak libc-test (and deprecate unsupported items, maybe) when updating emsdk. +EMSDK_VERSION=3.1.20 git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable cd /emsdk-portable -hide_output ./emsdk install "${EMSDK_VERSION}" +./emsdk install "${EMSDK_VERSION}" ./emsdk activate "${EMSDK_VERSION}" # Compile and cache libc # shellcheck disable=SC1091 source ./emsdk_env.sh -echo "main(){}" > a.c +echo "int main() {return 0;}" > a.c HOME=/emsdk-portable/ emcc a.c rm -f a.* diff --git a/ci/linux-sparc64.sh b/ci/linux-sparc64.sh index ae1c51c955711..db215cabf6ea3 100644 --- a/ci/linux-sparc64.sh +++ b/ci/linux-sparc64.sh @@ -5,7 +5,7 @@ set -ex mkdir -m 777 /qemu cd /qemu -curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2021-10-20/debian-11.0.0-sparc64-NETINST-1.iso +curl --retry 5 -LO https://cdimage.debian.org/cdimage/ports/snapshots/2022-03-28/debian-11.0.0-sparc64-NETINST-1.iso 7z e debian-11.0.0-sparc64-NETINST-1.iso install/initrd.gz 7z e debian-11.0.0-sparc64-NETINST-1.iso install/vmlinux mv vmlinux kernel diff --git a/libc-test/build.rs b/libc-test/build.rs index 9609cc55711b3..25481749bc56c 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2406,7 +2406,6 @@ fn test_emscripten(target: &str) { "sys/reboot.h", "sys/resource.h", "sys/sem.h", - "sys/sendfile.h", "sys/shm.h", "sys/signalfd.h", "sys/socket.h", @@ -2473,6 +2472,9 @@ fn test_emscripten(target: &str) { // FIXME: is this necessary? "sighandler_t" => true, + // FIXME: The size has been changed due to musl's time64 + "time_t" => true, + _ => false, } }); @@ -2491,6 +2493,16 @@ fn test_emscripten(target: &str) { // Skip for now to unblock CI. "pthread_condattr_t" => true, + // FIXME: The size has been changed when upgraded to musl 1.2.2 + "pthread_mutex_t" => true, + + // FIXME: The size has been changed + "max_align_t" => true, + + // FIXME: The size has been changed due to time64 + "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param" + | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true, + _ => false, } }); @@ -2503,6 +2515,14 @@ fn test_emscripten(target: &str) { // FIXME: Investigate why CI is missing it. "clearenv" => true, + // FIXME: Somehow the ctest cannot find it on emscripten: + // = note: error: undefined symbol: wait4 (referenced by top-level compiled C/C++ code) + // warning: Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols + // warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0` + // warning: _wait4 may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library + // Error: Aborting compilation due to previous errors + "wait4" => true, + _ => false, } }); @@ -2520,6 +2540,18 @@ fn test_emscripten(target: &str) { // emscripten-core/emscripten@6d6474e "SYS_gettid" => true, + // FIXME: These values have been changed + | "POSIX_MADV_DONTNEED" // to 4 + | "RLIMIT_NLIMITS" // to 16 + | "RLIM_NLIMITS" // to 16 + | "IPPROTO_MAX" // to 263 + | "F_GETLK" // to 5 + | "F_SETLK" // to 6 + | "F_SETLKW" // to 7 + | "O_TMPFILE" // to 65 + | "SIG_IGN" // -1 + => true, + _ => false, } }); @@ -2557,7 +2589,15 @@ fn test_emscripten(target: &str) { field == "_pad2" || field == "ssi_syscall" || field == "ssi_call_addr" || - field == "ssi_arch")) + field == "ssi_arch")) || + // FIXME: After musl 1.1.24, it have only one field `sched_priority`, + // while other fields become reserved. + (struct_ == "sched_param" && [ + "sched_ss_low_priority", + "sched_ss_repl_period", + "sched_ss_init_budget", + "sched_ss_max_repl", + ].contains(&field)) }); // FIXME: test linux like @@ -2695,6 +2735,7 @@ fn test_linux(target: &str) { let mips = target.contains("mips"); let mips32 = mips && !target.contains("64"); let mips64 = mips && target.contains("64"); + let ppc = target.contains("powerpc"); let ppc64 = target.contains("powerpc64"); let s390x = target.contains("s390x"); let sparc64 = target.contains("sparc64"); @@ -2702,7 +2743,7 @@ fn test_linux(target: &str) { let x86_32 = target.contains("i686"); let x86_64 = target.contains("x86_64"); let aarch64_musl = target.contains("aarch64") && musl; - let gnuabihf = target.contains("gnueabihf"); + let gnueabihf = target.contains("gnueabihf"); let x86_64_gnux32 = target.contains("gnux32") && x86_64; let riscv64 = target.contains("riscv64"); let uclibc = target.contains("uclibc"); @@ -2807,9 +2848,9 @@ fn test_linux(target: &str) { "errno.h", // `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit // ARM: https://bugzilla.redhat.com/show_bug.cgi?id=1116162 - // Also unavailable on gnuabihf with glibc 2.30. + // Also unavailable on gnueabihf with glibc 2.30. // https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6b33f373c7b9199e00ba5fbafd94ac9bfb4337b1 - [(x86_64 || x86_32 || arm) && !gnuabihf]: "sys/io.h", + [(x86_64 || x86_32 || arm) && !gnueabihf]: "sys/io.h", // `sys/reg.h` is only available on x86 and x86_64 [x86_64 || x86_32]: "sys/reg.h", // sysctl system call is deprecated and not available on musl @@ -2857,8 +2898,8 @@ fn test_linux(target: &str) { "linux/netfilter_ipv6.h", "linux/netfilter_ipv6/ip6_tables.h", "linux/netlink.h", - // FIXME: requires more recent kernel headers: - // "linux/openat2.h", + // FIXME: requires Linux >= 5.6: + [!musl && !sparc64]: "linux/openat2.h", [!musl]: "linux/ptrace.h", "linux/quota.h", "linux/random.h", @@ -3013,11 +3054,6 @@ fn test_linux(target: &str) { // which is absent in musl, has to be defined. "__exit_status" if musl => true, - // FIXME: CI's kernel header version is old. - "sockaddr_can" => true, - - // Requires glibc 2.33 or newer. - "mallinfo2" => true, // clone_args might differ b/w libc versions "clone_args" => true, @@ -3027,6 +3063,12 @@ fn test_linux(target: &str) { // FIXME: requires >= 5.4.1 kernel headers "j1939_filter" if musl => true, + // FIXME: requires >= 5.4 kernel headers + "sockaddr_can" if musl => true, + + // FIXME: Unignore once we update Ubuntu to 22.04 + "mallinfo2" if sparc64 => true, + _ => false, } }); @@ -3061,11 +3103,14 @@ fn test_linux(target: &str) { || name.starts_with("TCP_") || name.starts_with("UINPUT_") || name.starts_with("VMADDR_") - // FIXME: Requires >= 5.4.1 kernel headers - || name.starts_with("J1939") - // FIXME: Requires >= 5.4.1 kernel headers + { + return true; + } + } + if musl || sparc64 { + // FIXME: Requires >= 5.4.1 kernel headers + if name.starts_with("J1939") || name.starts_with("SO_J1939") - // FIXME: Requires >= 5.4.1 kernel headers || name.starts_with("SCM_J1939") { return true; @@ -3093,9 +3138,6 @@ fn test_linux(target: &str) { // because including `linux/if_arp.h` causes some conflicts: "ARPHRD_CAN" => true, - // Require Linux kernel 5.1: - "F_SEAL_FUTURE_WRITE" => true, - // FIXME: deprecated: not available in any header // See: https://github.com/rust-lang/libc/issues/1356 "ENOATTR" => true, @@ -3124,12 +3166,6 @@ fn test_linux(target: &str) { // deprecated: not available from Linux kernel 5.6: "VMADDR_CID_RESERVED" => true, - // Require Linux kernel 5.6: - "VMADDR_CID_LOCAL" => true, - - // Requires Linux kernel 5.7: - "MREMAP_DONTUNMAP" => true, - // IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP: | "IPPROTO_MAX" | "IPPROTO_MPTCP" => true, @@ -3142,52 +3178,20 @@ fn test_linux(target: &str) { // Not yet implemented on sparc64 "SYS_clone3" if mips | sparc64 => true, - // FIXME: these syscalls were added in Linux 5.9 or later - // and are currently not included in the glibc headers. - | "SYS_close_range" - | "SYS_openat2" - | "SYS_pidfd_getfd" - | "SYS_faccessat2" - | "SYS_process_madvise" - | "SYS_epoll_pwait2" - | "SYS_mount_setattr" => true, + // FIXME: Not defined on ARM, gnueabihf, MIPS, musl, PowerPC, riscv64, s390x, and sparc64. + "SYS_memfd_secret" if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 => true, - // FIXME: these syscalls were added in Linux 5.13 or later - // and are currently not included in the glibc headers. - | "SYS_quotactl_fd" - | "SYS_landlock_create_ruleset" - | "SYS_landlock_add_rule" - | "SYS_landlock_restrict_self" - | "SYS_memfd_secret" - | "SYS_process_mrelease" - | "SYS_futex_waitv" - | "SYS_set_mempolicy_home_node" => true, + // FIXME: Added in Linux 5.16 + // https://github.com/torvalds/linux/commit/039c0ec9bb77446d7ada7f55f90af9299b28ca49 + "SYS_futex_waitv" => true, - // Requires more recent kernel headers: - | "IFLA_PROP_LIST" - | "IFLA_ALT_IFNAME" - | "IFLA_PERM_ADDRESS" - | "IFLA_PROTO_DOWN_REASON" => true, + // FIXME: Added in Linux 5.17 + // https://github.com/torvalds/linux/commit/c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0 + "SYS_set_mempolicy_home_node" => true, - // FIXME: They require recent kernel header: - | "CAN_J1939" - | "CAN_RAW_FILTER_MAX" - | "CAN_NPROTO" => true, - - // FIXME: Requires recent kernel headers (5.15) - | "J1939_NLA_TOTAL_SIZE" - | "J1939_NLA_PGN" - | "J1939_NLA_SRC_NAME" - | "J1939_NLA_DEST_NAME" - | "J1939_NLA_SRC_ADDR" - | "J1939_NLA_DEST_ADDR" - | "J1939_EE_INFO_RX_RTS" - | "J1939_EE_INFO_RX_DPO" - | "J1939_EE_INFO_RX_ABORT" - | "SOL_CAN_J1939" => true, - - // FIXME: Requires recent kernel headers (5.8): - "STATX_MNT_ID" => true, + // FIXME: Added in Linux 5.18 + // https://github.com/torvalds/linux/commit/8b5413647262dda8d8d0e07e14ea1de9ac7cf0b2 + "NFQA_PRIORITY" => true, // FIXME: requires more recent kernel headers on CI | "UINPUT_VERSION" @@ -3195,18 +3199,6 @@ fn test_linux(target: &str) { | "SW_CNT" if mips || ppc64 || riscv64 || sparc64 => true, - // FIXME: Requires more recent kernel headers (5.9 / 5.11): - | "CLOSE_RANGE_UNSHARE" - | "CLOSE_RANGE_CLOEXEC" => true, - - // FIXME: requires more recent kernel headers: - | "RESOLVE_BENEATH" - | "RESOLVE_CACHED" - | "RESOLVE_IN_ROOT" - | "RESOLVE_NO_MAGICLINKS" - | "RESOLVE_NO_SYMLINKS" - | "RESOLVE_NO_XDEV" => true, - // FIXME: Not currently available in headers on ARM, MIPS and musl. "NETLINK_GET_STRICT_CHK" if arm || mips || musl => true, @@ -3233,14 +3225,10 @@ fn test_linux(target: &str) { // is a private value for kernel usage normally "FUSE_SUPER_MAGIC" => true, - // linux 5.12 min - "MPOL_F_NUMA_BALANCING" => true, + // linux 5.17 min "PR_SET_VMA" | "PR_SET_VMA_ANON_NAME" => true, - // GRND_INSECURE was added in glibc-2.32 - "GRND_INSECURE" => true, - // present in recent kernels only "PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true, @@ -3248,25 +3236,75 @@ fn test_linux(target: &str) { "FUTEX_LOCK_PI2" => true, // FIXME: Parts of netfilter/nfnetlink*.h require more recent kernel headers: - | "NFNL_SUBSYS_HOOK" // v5.14+ + | "RTNLGRP_MCTP_IFADDR" // linux v5.17+ + | "RTNLGRP_TUNNEL" // linux v5.18+ + | "RTNLGRP_STATS" // linux v5.18+ + => true, + + // FIXME: The below is no longer const in glibc 2.34: + // https://github.com/bminor/glibc/commit/5d98a7dae955bafa6740c26eaba9c86060ae0344 + | "PTHREAD_STACK_MIN" + | "SIGSTKSZ" + | "MINSIGSTKSZ" + if gnu => true, + + // FIXME: Linux >= 5.16 changed its value: + // https://github.com/torvalds/linux/commit/42df6e1d221dddc0f2acf2be37e68d553ad65f96 + "NF_NETDEV_NUMHOOKS" => true, + + // FIXME: requires Linux >= 5.6: + | "RESOLVE_BENEATH" + | "RESOLVE_CACHED" + | "RESOLVE_IN_ROOT" + | "RESOLVE_NO_MAGICLINKS" + | "RESOLVE_NO_SYMLINKS" + | "RESOLVE_NO_XDEV" if musl || sparc64 => true, + + // FIXME: requires Linux >= 5.4: + | "CAN_J1939" + | "CAN_NPROTO" if musl || sparc64 => true, + + // FIXME: requires Linux >= 5.6 + "GRND_INSECURE" if musl || sparc64 => true, + + // FIXME: requires Linux >= 5.7: + "MREMAP_DONTUNMAP" if musl || sparc64 => true, + + // FIXME: Requires more recent kernel headers (5.9 / 5.11): + | "CLOSE_RANGE_UNSHARE" + | "CLOSE_RANGE_CLOEXEC" if musl || sparc64 => true, + + // FIXME: requires Linux >= 5.12: + "MPOL_F_NUMA_BALANCING" if musl || sparc64 => true, + + // FIXME: Requires more recent kernel headers | "NFNL_SUBSYS_COUNT" // bumped in v5.14 - | "NFQA_VLAN" // v4.7+ - | "NFQA_L2HDR" // v4.7+ - | "NFQA_PRIORITY" // v5.18+ - | "NFQA_VLAN_UNSPEC" // v4.7+ - | "NFQA_VLAN_PROTO" // v4.7+ - | "NFQA_VLAN_TCI" // v4.7+ + | "NFNL_SUBSYS_HOOK" // v5.14+ | "NFULA_VLAN" // v5.4+ | "NFULA_L2HDR" // v5.4+ - | "NFULA_VLAN_UNSPEC" // v5.4+ | "NFULA_VLAN_PROTO" // v5.4+ - | "NFULA_VLAN_TCI" => true, // v5.4+ + | "NFULA_VLAN_TCI" // v5.4+ + | "NFULA_VLAN_UNSPEC" // v5.4+ | "RTNLGRP_NEXTHOP" // linux v5.3+ | "RTNLGRP_BRVLAN" // linux v5.6+ - | "RTNLGRP_MCTP_IFADDR" // linux v5.17+ - | "RTNLGRP_TUNNEL" // linux v5.18+ - | "RTNLGRP_STATS" // linux v5.18+ - => true, + if musl || sparc64 => true, + + // FIXME: Unignore once we update Ubuntu to 22.04 + | "VMADDR_CID_LOCAL" + | "STATX_MNT_ID" + | "SYS_close_range" + | "SYS_openat2" + | "SYS_pidfd_getfd" + | "SYS_faccessat2" + | "SYS_process_madvise" + | "SYS_epoll_pwait2" + | "SYS_mount_setattr" + | "SYS_quotactl_fd" + | "SYS_landlock_create_ruleset" + | "SYS_landlock_add_rule" + | "SYS_landlock_restrict_self" + | "SYS_process_mrelease" + if sparc64 => true, _ => false, } @@ -3424,7 +3462,10 @@ fn test_linux(target: &str) { // the `u` field is in fact an anonymous union (gnu && struct_ == "ptrace_syscall_info" && (field == "u" || field == "pad")) || // the vregs field is a `__uint128_t` C's type. - (struct_ == "user_fpsimd_struct" && field == "vregs") + (struct_ == "user_fpsimd_struct" && field == "vregs") || + // Linux >= 5.11 tweaked the `svm_zero` field of the `sockaddr_vm` struct. + // https://github.com/torvalds/linux/commit/dc8eeef73b63ed8988224ba6b5ed19a615163a7f + (struct_ == "sockaddr_vm" && field == "svm_zero") }); cfg.skip_roundtrip(move |s| match s {