Skip to content

Commit b14e947

Browse files
committed
Upgrade to musl 1.1.24 in CI
1 parent 779a08b commit b14e947

File tree

5 files changed

+59
-34
lines changed

5 files changed

+59
-34
lines changed

ci/docker/mips-unknown-linux-musl/Dockerfile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ FROM ubuntu:19.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
5-
bzip2
5+
xz-utils patch
66

77
RUN mkdir /toolchain
88

9-
# Note that this originally came from:
10-
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
11-
RUN curl --retry 5 -L https://ci-mirrors.rust-lang.org/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
12-
tar xjf - -C /toolchain --strip-components=1
9+
# Linux kernel version: 4.14.151
10+
# See build_dir/target-mips_24kc_musl/linux-ar71xx_generic/linux-4.14.151
11+
# Musl version: 1.1.24
12+
# See staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/info.mk
13+
RUN curl --retry 5 -L https://downloads.openwrt.org/releases/19.07.0-rc1/targets/ar71xx/generic/openwrt-sdk-19.07.0-rc1-ar71xx-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz | \
14+
tar xJf - -C /toolchain --strip-components=1
1315

14-
ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/bin \
15-
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
16-
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-openwrt-linux-gcc \
17-
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mips -L /toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15"
16+
# See https://lkml.org/lkml/2014/3/14/269
17+
COPY sysinfo_guard.patch /toolchain
18+
RUN patch /toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/include/linux/kernel.h </toolchain/sysinfo_guard.patch
19+
20+
ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/bin \
21+
STAGING_DIR=/toolchain/staging_dir \
22+
CC_mips_unknown_linux_musl=mips-openwrt-linux-musl-gcc \
23+
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-openwrt-linux-musl-gcc \
24+
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mips -L /toolchain/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl"
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
FROM ubuntu:19.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \
5-
bzip2
4+
gcc libc6-dev qemu-user ca-certificates qemu-system-mipsel curl \
5+
xz-utils patch
66

77
RUN mkdir /toolchain
88

9-
# Note that this originally came from:
10-
# https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
11-
RUN curl --retry 5 -L https://ci-mirrors.rust-lang.org/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
12-
tar xjf - -C /toolchain --strip-components=2
9+
# Linux kernel version: 4.14.151
10+
# See build_dir/target-mipsel_mips32_musl/linux-brcm47xx_generic/linux-4.14.151
11+
# Musl version: 1.1.24
12+
# See staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl/info.mk
13+
RUN curl --retry 5 -L https://downloads.openwrt.org/releases/19.07.0-rc1/targets/brcm47xx/generic/openwrt-sdk-19.07.0-rc1-brcm47xx-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz | \
14+
tar xJf - -C /toolchain --strip-components=1
1315

14-
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
15-
CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
16-
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_LINKER=mipsel-openwrt-linux-gcc \
17-
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mipsel -L /toolchain"
16+
# See https://lkml.org/lkml/2014/3/14/269
17+
COPY sysinfo_guard.patch /toolchain
18+
RUN patch /toolchain/staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl/include/linux/kernel.h </toolchain/sysinfo_guard.patch
19+
20+
ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl/bin \
21+
STAGING_DIR=/toolchain/staging_dir \
22+
CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-musl-gcc \
23+
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_LINKER=mipsel-openwrt-linux-musl-gcc \
24+
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_MUSL_RUNNER="qemu-mipsel -L /toolchain/staging_dir/toolchain-mipsel_mips32_gcc-7.4.0_musl"

ci/install-musl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -ex
77

8-
MUSL_VERSION=1.1.22
8+
MUSL_VERSION=1.1.24
99
MUSL="musl-${MUSL_VERSION}"
1010

1111
# Download, configure, build, and install musl:

ci/sysinfo_guard.patch

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@@ -2,7 +2,9 @@
2+
#ifndef _LINUX_KERNEL_H
3+
#define _LINUX_KERNEL_H
4+
5+
+#ifdef __GLIBC__
6+
#include <linux/sysinfo.h>
7+
+#endif
8+
9+
/*
10+
* 'kernel.h' contains some often-used function prototypes etc

libc-test/build.rs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,14 +2061,14 @@ fn test_linux(target: &str) {
20612061
let i686 = target.contains("i686");
20622062
let mips = target.contains("mips");
20632063
let mips32 = mips && !target.contains("64");
2064-
let mips32_musl = mips32 && musl;
20652064
let mips64 = mips && target.contains("64");
20662065
let ppc64 = target.contains("powerpc64");
20672066
let s390x = target.contains("s390x");
20682067
let sparc64 = target.contains("sparc64");
20692068
let x32 = target.contains("x32");
20702069
let x86_32 = target.contains("i686");
20712070
let x86_64 = target.contains("x86_64");
2071+
let aarch64_musl = target.contains("aarch64") && musl;
20722072

20732073
let mut cfg = ctest_cfg();
20742074
cfg.define("_GNU_SOURCE", None);
@@ -2132,8 +2132,7 @@ fn test_linux(target: &str) {
21322132
"sys/prctl.h",
21332133
"sys/ptrace.h",
21342134
"sys/quota.h",
2135-
// FIXME: the mips-musl CI build jobs use ancient musl 1.0.15:
2136-
[!mips32_musl]: "sys/random.h",
2135+
"sys/random.h",
21372136
"sys/reboot.h",
21382137
"sys/resource.h",
21392138
"sys/sem.h",
@@ -2187,8 +2186,7 @@ fn test_linux(target: &str) {
21872186
"linux/fs.h",
21882187
"linux/futex.h",
21892188
"linux/genetlink.h",
2190-
// FIXME: musl version 1.0.15 used by mips build jobs is ancient
2191-
[!mips32_musl]: "linux/if.h",
2189+
"linux/if.h",
21922190
"linux/if_addr.h",
21932191
"linux/if_alg.h",
21942192
"linux/if_ether.h",
@@ -2303,9 +2301,6 @@ fn test_linux(target: &str) {
23032301
// structs.
23042302
"termios2" => true,
23052303

2306-
// FIXME: musl version using by mips build jobs 1.0.15 is ancient:
2307-
"ifmap" | "ifreq" | "ifconf" if mips32_musl => true,
2308-
23092304
// FIXME: remove once Ubuntu 20.04 LTS is released, somewhere in 2020.
23102305
// ucontext_t added a new field as of glibc 2.28; our struct definition is
23112306
// conservative and omits the field, but that means the size doesn't match for newer
@@ -2349,7 +2344,7 @@ fn test_linux(target: &str) {
23492344
// Require Linux kernel 5.1:
23502345
"F_SEAL_FUTURE_WRITE" => true,
23512346

2352-
// The musl version 1.0.22 used in CI does not
2347+
// The musl version 1.1.24 used in CI does not
23532348
// contain these glibc constants yet:
23542349
| "RLIMIT_RTTIME" // should be in `resource.h`
23552350
| "TCP_COOKIE_TRANSACTIONS" // should be in the `netinet/tcp.h` header
@@ -2371,10 +2366,6 @@ fn test_linux(target: &str) {
23712366
// - these constants are used by the glibc implementation.
23722367
n if musl && n.contains("__SIZEOF_PTHREAD") => true,
23732368

2374-
// FIXME: musl version 1.0.15 used by mips build jobs is ancient
2375-
t if mips32_musl && t.starts_with("IFF") => true,
2376-
"MFD_HUGETLB" | "AF_XDP" | "PF_XDP" if mips32_musl => true,
2377-
23782369
_ => false,
23792370
}
23802371
});
@@ -2458,7 +2449,17 @@ fn test_linux(target: &str) {
24582449
field == "_pad2" ||
24592450
field == "ssi_syscall" ||
24602451
field == "ssi_call_addr" ||
2461-
field == "ssi_arch"))
2452+
field == "ssi_arch")) ||
2453+
// FIXME: After musl 1.1.24, it have only one field `sched_priority`,
2454+
// while other fields become reserved.
2455+
(struct_ == "sched_param" && [
2456+
"sched_ss_low_priority",
2457+
"sched_ss_repl_period",
2458+
"sched_ss_init_budget",
2459+
"sched_ss_max_repl",
2460+
].contains(&field) && musl) ||
2461+
// FIXME: After musl 1.1.24, the type becomes `int` instead of `unsigned short`.
2462+
(struct_ == "ipc_perm" && field == "__seq" && aarch64_musl)
24622463
});
24632464

24642465
cfg.skip_roundtrip(move |s| match s {

0 commit comments

Comments
 (0)