Skip to content

Commit 6e96802

Browse files
committed
Auto merge of #107129 - wesleywiser:musl_1.2_upgrade, r=petrochenkov
Update the version of musl used on `*-linux-musl` targets to 1.2.3 Update the version of musl used on our Linux musl targets from 1.1.24 to 1.2.3 as proposed in rust-lang/compiler-team#572. musl 1.2.3 is the latest version of musl and supports the same range of Linux kernels as the 1.1 series. As such, it does not affect the minimum supported version of Linux for any of the musl targets. One of the major musl 1.2 features is support for [time64](https://musl.libc.org/time64.html). This support is both source and ABI compatible with programs built against musl 1.1 and so updating the musl version for these targets should not cause Rust programs to fail to run or compile (a [crater run](#107129 (comment)) has been completed which demonstrates this for the `i686-unknown-linux-musl` target). Once this change reaches stable, the `libc` crate will then be able to [update their definitions to support 64-bit time](rust-lang/libc#3068), matching the default musl 1.2 APIs exactly. Fixes #91178
2 parents 6d140d5 + cb93f92 commit 6e96802

File tree

5 files changed

+7
-16
lines changed

5 files changed

+7
-16
lines changed

src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ RUN sh /scripts/crosstool-ng.sh
88

99
WORKDIR /build
1010

11-
COPY scripts/musl-patch-configure.diff /build/
1211
COPY scripts/musl-toolchain.sh /build/
1312
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
1413
RUN CFLAGS="-Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \

src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ WORKDIR /build/
2525
COPY scripts/cmake.sh /scripts/
2626
RUN /scripts/cmake.sh
2727

28-
COPY scripts/musl-patch-configure.diff /build/
2928
COPY scripts/musl-toolchain.sh /build/
3029
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
3130
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \

src/ci/docker/host-x86_64/test-various/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ RUN curl -sL --output ovmf-ia32.deb http://mirrors.kernel.org/ubuntu/pool/univer
3333
RUN dpkg -i ovmf-ia32.deb && rm ovmf-ia32.deb
3434

3535
WORKDIR /build/
36-
COPY scripts/musl-patch-configure.diff /build/
3736
COPY scripts/musl-toolchain.sh /build/
3837
RUN bash musl-toolchain.sh x86_64 && rm -rf build
3938
WORKDIR /

src/ci/docker/scripts/musl-toolchain.sh

+6-12
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Versions of the toolchain components are configurable in `musl-cross-make/Makefile` and
66
# musl unlike GLIBC is forward compatible so upgrading it shouldn't break old distributions.
7-
# Right now we have: Binutils 2.31.1, GCC 9.2.0, musl 1.1.24.
7+
# Right now we have: Binutils 2.31.1, GCC 9.2.0, musl 1.2.3.
88

99
# ignore-tidy-linelength
1010

@@ -32,6 +32,7 @@ TARGET=$ARCH-linux-musl
3232

3333
# Don't depend on the mirrors of sabotage linux that musl-cross-make uses.
3434
LINUX_HEADERS_SITE=https://ci-mirrors.rust-lang.org/rustc/sabotage-linux-tarballs
35+
LINUX_VER=headers-4.19.88
3536

3637
OUTPUT=/usr/local
3738
shift
@@ -44,18 +45,11 @@ export CFLAGS="-fPIC -g1 $CFLAGS"
4445

4546
git clone https://github.com/richfelker/musl-cross-make # -b v0.9.9
4647
cd musl-cross-make
47-
# A few commits ahead of v0.9.9 to include the cowpatch fix:
48-
git checkout a54eb56f33f255dfca60be045f12a5cfaf5a72a9
48+
# A version that includes support for building musl 1.2.3
49+
git checkout fe915821b652a7fa37b34a596f47d8e20bc72338
4950

50-
# Fix the cfi detection script in musl's configure so cfi is generated
51-
# when debug info is asked for. This patch is derived from
52-
# https://git.musl-libc.org/cgit/musl/commit/?id=c4d4028dde90562f631edf559fbc42d8ec1b29de.
53-
# When we upgrade to a version that includes this commit, we can remove the patch.
54-
mkdir patches/musl-1.1.24
55-
cp ../musl-patch-configure.diff patches/musl-1.1.24/0001-fix-cfi-detection.diff
56-
57-
hide_output make -j$(nproc) TARGET=$TARGET MUSL_VER=1.1.24 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE
58-
hide_output make install TARGET=$TARGET MUSL_VER=1.1.24 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE OUTPUT=$OUTPUT
51+
hide_output make -j$(nproc) TARGET=$TARGET MUSL_VER=1.2.3 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE LINUX_VER=$LINUX_VER
52+
hide_output make install TARGET=$TARGET MUSL_VER=1.2.3 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE LINUX_VER=$LINUX_VER OUTPUT=$OUTPUT
5953

6054
cd -
6155

src/ci/docker/scripts/musl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ shift
2525
# Apparently applying `-fPIC` everywhere allows them to link successfully.
2626
export CFLAGS="-fPIC $CFLAGS"
2727

28-
MUSL=musl-1.1.24
28+
MUSL=musl-1.2.3
2929

3030
# may have been downloaded in a previous run
3131
if [ ! -d $MUSL ]; then

0 commit comments

Comments
 (0)