From 3565a9e0af424dc24eacd360b871d441cd7905ea Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 20 Sep 2022 12:25:09 +0800 Subject: [PATCH] Update GCC to 11.2.0, align musl version with Rust --- Dockerfile | 7 ++----- build-std.sh | 4 ++-- config.mak | 9 +++++++-- config.mak.32 | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6dcd99..ce70655 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,14 +36,11 @@ RUN update-ca-certificates ARG TARGET=x86_64-unknown-linux-musl ENV RUST_MUSL_CROSS_TARGET=$TARGET -ARG RUST_MUSL_MAKE_VER=0.9.9 ARG RUST_MUSL_MAKE_CONFIG=config.mak COPY $RUST_MUSL_MAKE_CONFIG /tmp/config.mak -RUN cd /tmp && curl -Lsq -o musl-cross-make.zip https://github.com/richfelker/musl-cross-make/archive/v$RUST_MUSL_MAKE_VER.zip && \ - unzip -q musl-cross-make.zip && \ - rm musl-cross-make.zip && \ - mv musl-cross-make-$RUST_MUSL_MAKE_VER musl-cross-make && \ +RUN cd /tmp && \ + git clone --depth 1 https://github.com/richfelker/musl-cross-make.git && \ cp /tmp/config.mak /tmp/musl-cross-make/config.mak && \ cd /tmp/musl-cross-make && \ export TARGET=$TARGET && \ diff --git a/build-std.sh b/build-std.sh index 72251ec..b53815c 100755 --- a/build-std.sh +++ b/build-std.sh @@ -16,11 +16,11 @@ then cd custom-std cp /tmp/Xargo.toml . rustc -Z unstable-options --print target-spec-json --target "$TARGET" | tee "$TARGET.json" - RUSTFLAGS="-L/usr/local/musl/$TARGET/lib -L/usr/local/musl/lib/gcc/$TARGET/9.2.0/" xargo build --target "$TARGET" + RUSTFLAGS="-L/usr/local/musl/$TARGET/lib -L/usr/local/musl/lib/gcc/$TARGET/11.2.0/" xargo build --target "$TARGET" cp -r "/root/.xargo/lib/rustlib/$TARGET" "/root/.rustup/toolchains/$TOOLCHAIN-$HOST/lib/rustlib/" mkdir "/root/.rustup/toolchains/$TOOLCHAIN-$HOST/lib/rustlib/$TARGET/lib/self-contained" cp /usr/local/musl/"$TARGET"/lib/*.o "/root/.rustup/toolchains/$TOOLCHAIN-$HOST/lib/rustlib/$TARGET/lib/self-contained/" - cp /usr/local/musl/lib/gcc/"$TARGET"/9.2.0/c*.o "/root/.rustup/toolchains/$TOOLCHAIN-$HOST/lib/rustlib/$TARGET/lib/self-contained/" + cp /usr/local/musl/lib/gcc/"$TARGET"/11.2.0/c*.o "/root/.rustup/toolchains/$TOOLCHAIN-$HOST/lib/rustlib/$TARGET/lib/self-contained/" cd .. rm -rf /root/.xargo /root/.cargo/registry /root/.cargo/git custom-std diff --git a/config.mak b/config.mak index 2c8356a..cde1957 100644 --- a/config.mak +++ b/config.mak @@ -16,8 +16,13 @@ OUTPUT = /usr/local/musl # headers, which are not needed unless compiling programs that use them. # BINUTILS_VER = -# GCC_VER = -# MUSL_VER = +GCC_VER = 11.2.0 + +# https://github.com/rust-embedded/cross/issues/478 +# https://github.com/rust-lang/libc/issues/1848 + +MUSL_VER = 1.1.24 + # GMP_VER = # MPC_VER = # MPFR_VER = diff --git a/config.mak.32 b/config.mak.32 index eaa2e32..cde1957 100644 --- a/config.mak.32 +++ b/config.mak.32 @@ -16,7 +16,7 @@ OUTPUT = /usr/local/musl # headers, which are not needed unless compiling programs that use them. # BINUTILS_VER = -# GCC_VER = +GCC_VER = 11.2.0 # https://github.com/rust-embedded/cross/issues/478 # https://github.com/rust-lang/libc/issues/1848