Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the version of musl used on *-linux-musl targets to 1.2.3 #107129

Merged
merged 3 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN sh /scripts/crosstool-ng-1.24.sh

WORKDIR /build

COPY scripts/musl-patch-configure.diff /build/
COPY scripts/musl-toolchain.sh /build/
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
RUN CFLAGS="-Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ WORKDIR /build/
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh

COPY scripts/musl-patch-configure.diff /build/
COPY scripts/musl-toolchain.sh /build/
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/test-various/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ RUN curl -sL --output ovmf-ia32.deb http://mirrors.kernel.org/ubuntu/pool/univer
RUN dpkg -i ovmf-ia32.deb && rm ovmf-ia32.deb

WORKDIR /build/
COPY scripts/musl-patch-configure.diff /build/
COPY scripts/musl-toolchain.sh /build/
RUN bash musl-toolchain.sh x86_64 && rm -rf build
WORKDIR /
Expand Down
18 changes: 6 additions & 12 deletions src/ci/docker/scripts/musl-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Versions of the toolchain components are configurable in `musl-cross-make/Makefile` and
# musl unlike GLIBC is forward compatible so upgrading it shouldn't break old distributions.
# Right now we have: Binutils 2.31.1, GCC 9.2.0, musl 1.1.24.
# Right now we have: Binutils 2.31.1, GCC 9.2.0, musl 1.2.3.

# ignore-tidy-linelength

Expand Down Expand Up @@ -32,6 +32,7 @@ TARGET=$ARCH-linux-musl

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

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

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

# Fix the cfi detection script in musl's configure so cfi is generated
# when debug info is asked for. This patch is derived from
# https://git.musl-libc.org/cgit/musl/commit/?id=c4d4028dde90562f631edf559fbc42d8ec1b29de.
# When we upgrade to a version that includes this commit, we can remove the patch.
mkdir patches/musl-1.1.24
cp ../musl-patch-configure.diff patches/musl-1.1.24/0001-fix-cfi-detection.diff

hide_output make -j$(nproc) TARGET=$TARGET MUSL_VER=1.1.24 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE
hide_output make install TARGET=$TARGET MUSL_VER=1.1.24 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE OUTPUT=$OUTPUT
hide_output make -j$(nproc) TARGET=$TARGET MUSL_VER=1.2.3 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE LINUX_VER=$LINUX_VER
hide_output make install TARGET=$TARGET MUSL_VER=1.2.3 LINUX_HEADERS_SITE=$LINUX_HEADERS_SITE LINUX_VER=$LINUX_VER OUTPUT=$OUTPUT

cd -

Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ shift
# Apparently applying `-fPIC` everywhere allows them to link successfully.
export CFLAGS="-fPIC $CFLAGS"

MUSL=musl-1.1.24
MUSL=musl-1.2.3

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