From 1b201de3491846f23f44b90c35b9554bf43facfb Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 20 Sep 2022 07:55:27 +0900 Subject: [PATCH 01/15] Update Docker image to Ubuntu 22.04 Signed-off-by: Yuki Okushi --- ci/docker/aarch64-linux-android/Dockerfile | 2 +- ci/docker/aarch64-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/aarch64-unknown-linux-musl/Dockerfile | 2 +- ci/docker/arm-linux-androideabi/Dockerfile | 2 +- ci/docker/arm-unknown-linux-gnueabihf/Dockerfile | 2 +- ci/docker/arm-unknown-linux-musleabihf/Dockerfile | 2 +- ci/docker/armv7-unknown-linux-uclibceabihf/Dockerfile | 2 +- ci/docker/asmjs-unknown-emscripten/Dockerfile | 2 +- ci/docker/i686-linux-android/Dockerfile | 2 +- ci/docker/i686-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/i686-unknown-linux-musl/Dockerfile | 2 +- ci/docker/mips-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/mips-unknown-linux-musl/Dockerfile | 2 +- ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile | 2 +- ci/docker/mips64-unknown-linux-muslabi64/Dockerfile | 2 +- ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile | 2 +- ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile | 2 +- ci/docker/mipsel-unknown-linux-musl/Dockerfile | 2 +- ci/docker/mipsel-unknown-linux-uclibc/Dockerfile | 2 +- ci/docker/powerpc-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/powerpc64-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/riscv64gc-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/s390x-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/s390x-unknown-linux-musl/Dockerfile | 2 +- ci/docker/sparc64-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/wasm32-unknown-emscripten/Dockerfile | 2 +- ci/docker/wasm32-wasi/Dockerfile | 2 +- ci/docker/x86_64-linux-android/Dockerfile | 2 +- ci/docker/x86_64-unknown-linux-gnu/Dockerfile | 2 +- ci/docker/x86_64-unknown-linux-gnux32/Dockerfile | 2 +- ci/docker/x86_64-unknown-linux-musl/Dockerfile | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) 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..72a47f29020e2 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 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..ff6810a7fac58 100644 --- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/sparc64-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/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile index 999b28c83c2a8..0722aa1beab4c 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 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 \ From 2cc4a61170e0d69e885b88ca14c8386e23b60ffe Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 20 Sep 2022 19:39:54 +0900 Subject: [PATCH 02/15] test: Ignore some items changed in recent Linux versions Signed-off-by: Yuki Okushi --- libc-test/build.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 9609cc55711b3..f3350fbef10c9 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3268,6 +3268,17 @@ fn test_linux(target: &str) { | "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, + _ => false, } }); @@ -3424,7 +3435,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 { From 1f1527e580b1fc6c1d6114968b217680eb1d087b Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 20 Sep 2022 19:48:29 +0900 Subject: [PATCH 03/15] test: Unignore some items Signed-off-by: Yuki Okushi --- libc-test/build.rs | 118 +++++---------------------------------------- 1 file changed, 13 insertions(+), 105 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index f3350fbef10c9..6e676e9657436 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2857,8 +2857,7 @@ 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", + "linux/openat2.h", [!musl]: "linux/ptrace.h", "linux/quota.h", "linux/random.h", @@ -2956,11 +2955,6 @@ fn test_linux(target: &str) { // For internal use only, to define architecture specific ioctl constants with a libc specific type. "Ioctl" => true, - // FIXME: requires >= 5.4.1 kernel headers - "pgn_t" if musl => true, - "priority_t" if musl => true, - "name_t" if musl => true, - _ => false, } }); @@ -3013,11 +3007,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, @@ -3061,12 +3050,6 @@ 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 - || name.starts_with("SO_J1939") - // FIXME: Requires >= 5.4.1 kernel headers - || name.starts_with("SCM_J1939") { return true; } @@ -3093,9 +3076,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 +3104,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 +3116,17 @@ 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: 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, - - // Requires more recent kernel headers: - | "IFLA_PROP_LIST" - | "IFLA_ALT_IFNAME" - | "IFLA_PERM_ADDRESS" - | "IFLA_PROTO_DOWN_REASON" => 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.16 + // https://github.com/torvalds/linux/commit/039c0ec9bb77446d7ada7f55f90af9299b28ca49 + "SYS_futex_waitv" => true, + + // FIXME: Added in Linux 5.17 + // https://github.com/torvalds/linux/commit/c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0 + "SYS_set_mempolicy_home_node" => 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 +3134,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 +3160,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,21 +3171,6 @@ 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+ - | "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+ - | "NFULA_VLAN" // v5.4+ - | "NFULA_L2HDR" // v5.4+ - | "NFULA_VLAN_UNSPEC" // v5.4+ - | "NFULA_VLAN_PROTO" // v5.4+ - | "NFULA_VLAN_TCI" => true, // 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+ From 73d674b61a0b229b18259e9e0ee855433ddd241d Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 24 Sep 2022 00:28:59 +0100 Subject: [PATCH 04/15] mmap/madvise specific solaris additional flags. --- src/unix/solarish/illumos.rs | 2 ++ src/unix/solarish/mod.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/unix/solarish/illumos.rs b/src/unix/solarish/illumos.rs index daf9e6975893c..7d491d382a74f 100644 --- a/src/unix/solarish/illumos.rs +++ b/src/unix/solarish/illumos.rs @@ -54,6 +54,8 @@ pub const FILF_AUTO: ::c_int = 0x2; pub const FILF_BYPASS: ::c_int = 0x4; pub const SOL_FILTER: ::c_int = 0xfffc; +pub const MADV_PURGE: ::c_int = 9; + pub const MR_HDR_AOUT: ::c_uint = 0x3; pub const B1000000: ::speed_t = 24; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index eb924b561855f..4041c67cf88fd 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1440,6 +1440,7 @@ pub const MAP_RENAME: ::c_int = 0x20; pub const MAP_ALIGN: ::c_int = 0x200; pub const MAP_TEXT: ::c_int = 0x400; pub const MAP_INITDATA: ::c_int = 0x800; +pub const MAP_32BIT: ::c_int = 0x80; pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void; pub const MCL_CURRENT: ::c_int = 0x0001; @@ -1683,6 +1684,9 @@ pub const MADV_SEQUENTIAL: ::c_int = 2; pub const MADV_WILLNEED: ::c_int = 3; pub const MADV_DONTNEED: ::c_int = 4; pub const MADV_FREE: ::c_int = 5; +pub const MADV_ACCESS_DEFAULT: ::c_int = 6; +pub const MADV_ACCESS_LWP: ::c_int = 7; +pub const MADV_ACCESS_MANY: ::c_int = 8; pub const AF_UNSPEC: ::c_int = 0; pub const AF_UNIX: ::c_int = 1; From a1d75786b70f949360d826aec51a608919510776 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 24 Sep 2022 22:17:42 +0900 Subject: [PATCH 05/15] Try to update emsdk version Signed-off-by: Yuki Okushi --- ci/docker/asmjs-unknown-emscripten/Dockerfile | 3 ++- .../wasm32-unknown-emscripten/Dockerfile | 3 ++- ci/emscripten.sh | 25 ++++--------------- libc-test/build.rs | 10 +++++++- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/ci/docker/asmjs-unknown-emscripten/Dockerfile b/ci/docker/asmjs-unknown-emscripten/Dockerfile index 72a47f29020e2..65d1a949ec577 100644 --- a/ci/docker/asmjs-unknown-emscripten/Dockerfile +++ b/ci/docker/asmjs-unknown-emscripten/Dockerfile @@ -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/wasm32-unknown-emscripten/Dockerfile b/ci/docker/wasm32-unknown-emscripten/Dockerfile index 0722aa1beab4c..5a10efe16eb12 100644 --- a/ci/docker/wasm32-unknown-emscripten/Dockerfile +++ b/ci/docker/wasm32-unknown-emscripten/Dockerfile @@ -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/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/libc-test/build.rs b/libc-test/build.rs index 6e676e9657436..651bb09e1de08 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2557,7 +2557,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 From 30b8c52be9f7ff78eb7eec2c7fa795b8d46af98a Mon Sep 17 00:00:00 2001 From: Pedro Tammela Date: Mon, 26 Sep 2022 21:03:43 +0200 Subject: [PATCH 06/15] fs: add NSFS_MAGIC constant NSFS_MAGIC defines the filesystem type for namespaces in Linux --- src/unix/linux_like/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 57600f24b8f12..46964cc1736ab 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -1434,6 +1434,7 @@ cfg_if! { pub const UDF_SUPER_MAGIC: ::c_long = 0x15013346; pub const USBDEVICE_SUPER_MAGIC: ::c_long = 0x00009fa2; pub const XENFS_SUPER_MAGIC: ::c_long = 0xabba1974; + pub const NSFS_MAGIC: ::c_long = 0x6e736673; } else if #[cfg(target_arch = "s390x")] { pub const ADFS_SUPER_MAGIC: ::c_uint = 0x0000adf5; pub const AFFS_SUPER_MAGIC: ::c_uint = 0x0000adff; @@ -1487,6 +1488,7 @@ cfg_if! { pub const UDF_SUPER_MAGIC: ::c_uint = 0x15013346; pub const USBDEVICE_SUPER_MAGIC: ::c_uint = 0x00009fa2; pub const XENFS_SUPER_MAGIC: ::c_uint = 0xabba1974; + pub const NSFS_MAGIC: ::c_uint = 0x6e736673; } } From 5dc92a12ae51bf95bb436ce4dc29cda2f8cdca0a Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 26 Sep 2022 13:33:01 +0100 Subject: [PATCH 07/15] CPU_SETSIZE constant to dragonflybsd. --- libc-test/semver/dragonfly.txt | 1 + src/unix/bsd/freebsdlike/dragonfly/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 448b4fb4f4bc6..e56441640b813 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -145,6 +145,7 @@ CODESET CPU_CLR CPU_ISSET CPU_SET +CPU_SETSIZE CPU_ZERO CPUCTL_RSMSR CPUCTL_WRMSR diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 2935534f0d6a9..418ac3dc802c2 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -1066,6 +1066,8 @@ pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305; pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306; pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307; +pub const CPU_SETSIZE: ::size_t = ::mem::size_of::<::cpumask_t>() * 8; + pub const EVFILT_READ: i16 = -1; pub const EVFILT_WRITE: i16 = -2; pub const EVFILT_AIO: i16 = -3; From 63cc149be9aca678f7976222a79cdb268b573a76 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 24 Sep 2022 22:59:57 +0900 Subject: [PATCH 08/15] Ignore some items Signed-off-by: Yuki Okushi --- libc-test/build.rs | 124 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 120 insertions(+), 4 deletions(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 651bb09e1de08..9e390bd323f27 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2473,6 +2473,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 +2494,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 +2516,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 +2541,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, } }); @@ -2703,6 +2736,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"); @@ -2710,7 +2744,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"); @@ -2815,9 +2849,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 @@ -2865,7 +2899,8 @@ fn test_linux(target: &str) { "linux/netfilter_ipv6.h", "linux/netfilter_ipv6/ip6_tables.h", "linux/netlink.h", - "linux/openat2.h", + // FIXME: requires Linux >= 5.6: + [!musl && !sparc64]: "linux/openat2.h", [!musl]: "linux/ptrace.h", "linux/quota.h", "linux/random.h", @@ -2963,6 +2998,11 @@ fn test_linux(target: &str) { // For internal use only, to define architecture specific ioctl constants with a libc specific type. "Ioctl" => true, + // FIXME: requires >= 5.4.1 kernel headers + "pgn_t" if musl => true, + "priority_t" if musl => true, + "name_t" if musl => true, + _ => false, } }); @@ -3024,6 +3064,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, } }); @@ -3062,6 +3108,15 @@ fn test_linux(target: &str) { return true; } } + if musl || sparc64 { + // FIXME: Requires >= 5.4.1 kernel headers + if name.starts_with("J1939") + || name.starts_with("SO_J1939") + || name.starts_with("SCM_J1939") + { + return true; + } + } match name { // These constants are not available if gnu headers have been included // and can therefore not be tested here @@ -3124,6 +3179,9 @@ fn test_linux(target: &str) { // Not yet implemented on sparc64 "SYS_clone3" if mips | sparc64 => 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: Added in Linux 5.16 // https://github.com/torvalds/linux/commit/039c0ec9bb77446d7ada7f55f90af9299b28ca49 "SYS_futex_waitv" => true, @@ -3195,6 +3253,64 @@ fn test_linux(target: &str) { // 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 + | "NFNL_SUBSYS_HOOK" // v5.14+ + | "NFULA_VLAN" // v5.4+ + | "NFULA_L2HDR" // v5.4+ + | "NFULA_VLAN_PROTO" // v5.4+ + | "NFULA_VLAN_TCI" // v5.4+ + | "NFULA_VLAN_UNSPEC" // v5.4+ + | "RTNLGRP_NEXTHOP" // linux v5.3+ + | "RTNLGRP_BRVLAN" // linux v5.6+ + 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" + | "IFLA_PROP_LIST" + | "IFLA_ALT_IFNAME" + | "IFLA_PERM_ADDRESS" + | "IFLA_PROTO_DOWN_REASON" + if sparc64 => true, + _ => false, } }); From 0233e88a162bdce58c9d08ecb8750a0ebec8d011 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 25 Sep 2022 21:37:13 +0900 Subject: [PATCH 09/15] Do not import `sys/sendfile.h` It now causes an error because emsdk removed it. Signed-off-by: Yuki Okushi --- libc-test/build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 9e390bd323f27..d1718454e4e70 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", From 737c37d723866abc1fd1cd8d47441b53ca5cf314 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 27 Sep 2022 17:59:22 +0900 Subject: [PATCH 10/15] Update sparc64 Debian image Signed-off-by: Yuki Okushi --- ci/linux-sparc64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a119fdbf38192df88281b2f271ee3e43439ef268 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 27 Sep 2022 19:43:47 +0900 Subject: [PATCH 11/15] Downgrade to Ubuntu 20.04 on sparc64 ...because of glibc version mismatching between Debian and Ubuntu. Signed-off-by: Yuki Okushi --- ci/docker/sparc64-unknown-linux-gnu/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile index ff6810a7fac58..d45e56195dede 100644 --- a/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/ci/docker/sparc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,5 @@ -FROM ubuntu:22.04 +# 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 \ curl ca-certificates \ From 1d7029adb840ba50e43f8e0aedb28fbddf322cdd Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Thu, 29 Sep 2022 01:47:05 -0700 Subject: [PATCH 12/15] Use `::Option` and not `Option` for `pthread_jit_write_callback_t` --- src/unix/bsd/apple/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 8c30eb2de3eb9..d17d5e0050558 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -119,7 +119,7 @@ pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy; pub type pthread_introspection_hook_t = extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t); -pub type pthread_jit_write_callback_t = Option ::c_int>; +pub type pthread_jit_write_callback_t = ::Option ::c_int>; pub type vm_statistics_t = *mut vm_statistics; pub type vm_statistics_data_t = vm_statistics; From 1c2ffa763c8d09c8e7be690833f38309ca8cfac8 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 29 Sep 2022 20:21:43 +0900 Subject: [PATCH 13/15] Prepare 0.2.134 release Signed-off-by: Yuki Okushi --- Cargo.toml | 2 +- libc-test/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00aca212dee89..018cdf69b6715 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc" -version = "0.2.133" +version = "0.2.134" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index a5020485381f3..15d525597550a 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc-test" -version = "0.2.133" +version = "0.2.134" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" build = "build.rs" @@ -12,7 +12,7 @@ A test crate for the libc crate. [dependencies.libc] path = ".." -version = "0.2.133" +version = "0.2.134" default-features = false [build-dependencies] From 9dc36bdcb0fe28da0aaf9ca17f70020a685ba4e6 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 29 Sep 2022 21:41:50 +0900 Subject: [PATCH 14/15] Deploy GitHub Pages via GitHub Actions Signed-off-by: Yuki Okushi --- .github/workflows/docs.yml | 43 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 11eac70fcad78..50102b83ec50a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,34 +1,35 @@ -name: Upload documentation +name: Upload documentation to GitHub Pages on: push: branches: - master +# Sets permissions of `GITHUB_TOKEN` to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + jobs: - upload_docs: - name: Upload documentation + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-22.04 - if: github.repository == 'rust-lang/libc' - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - name: Checkout + uses: actions/checkout@v3 - name: Setup Rust toolchain run: TARGET=x86_64-unknown-linux-gnu sh ./ci/install-rust.sh - name: Generate documentation run: LIBC_CI=1 sh ci/dox.sh - - name: Deploy GitHub Pages - run: | - git worktree add gh-pages gh-pages - git config user.name "Deploy from CI" - git config user.email "" - cd gh-pages - # Delete the ref to avoid keeping history. - git update-ref -d refs/heads/gh-pages - rm -rf * - mv ../target/doc/* . - git add . - git commit -m "Deploy $GITHUB_SHA to gh-pages" - git push --force + - name: Setup Pages + uses: actions/configure-pages@v2 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: 'target/doc' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 From 2bd3e499a79afa9b786d9859c5dfb4446ae22286 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 25 Sep 2022 00:17:29 +0100 Subject: [PATCH 15/15] linux add ptrace_rseq_configuration --- libc-test/build.rs | 3 +++ libc-test/semver/linux-gnu-x86_64.txt | 2 ++ src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index d1718454e4e70..0e56050b008de 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3068,6 +3068,7 @@ fn test_linux(target: &str) { // FIXME: Unignore once we update Ubuntu to 22.04 "mallinfo2" if sparc64 => true, + "ptrace_rseq_configuration" if sparc64 => true, _ => false, } @@ -3309,6 +3310,8 @@ fn test_linux(target: &str) { | "IFLA_PERM_ADDRESS" | "IFLA_PROTO_DOWN_REASON" if sparc64 => true, + // Added in Linux 5.13 + "PTRACE_GET_RSEQ_CONFIGURATION" if sparc64 => true, _ => false, } diff --git a/libc-test/semver/linux-gnu-x86_64.txt b/libc-test/semver/linux-gnu-x86_64.txt index dfe109307fbd1..604f7d845e7b7 100644 --- a/libc-test/semver/linux-gnu-x86_64.txt +++ b/libc-test/semver/linux-gnu-x86_64.txt @@ -19,12 +19,14 @@ NFT_MSG_NEWOBJ PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +PTRACE_GET_RSEQ_CONFIGURATION PTRACE_SYSEMU PTRACE_SYSEMU_SINGLESTEP _libc_fpstate flock64 getcontext makecontext +ptrace_rseq_configuration setcontext swapcontext termios2 diff --git a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs index 7e876f2d86c87..d515d22315d0c 100644 --- a/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs @@ -265,6 +265,14 @@ s! { pub seccomp_notif_resp: ::__u16, pub seccomp_data: ::__u16, } + + pub struct ptrace_rseq_configuration { + pub rseq_abi_pointer: ::__u64, + pub rseq_abi_size: ::__u32, + pub signature: ::__u32, + pub flags: ::__u32, + pub pad: ::__u32, + } } s_no_extra_traits! { @@ -535,6 +543,7 @@ pub const O_ASYNC: ::c_int = 0x2000; pub const O_NDELAY: ::c_int = 0x800; pub const PTRACE_DETACH: ::c_uint = 17; +pub const PTRACE_GET_RSEQ_CONFIGURATION: ::c_uint = 0x420f; pub const EFD_NONBLOCK: ::c_int = 0x800;