diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/ci/docker/host-x86_64/dist-x86_64-musl | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ci/docker/host-x86_64/dist-x86_64-musl')
-rw-r--r-- | src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile new file mode 100644 index 000000000..51645a818 --- /dev/null +++ b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile @@ -0,0 +1,58 @@ +FROM ubuntu:20.04 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + g++ \ + make \ + ninja-build \ + file \ + wget \ + curl \ + ca-certificates \ + python3 \ + git \ + cmake \ + xz-utils \ + sudo \ + gdb \ + patch \ + libssl-dev \ + pkg-config + +WORKDIR /build/ + +# Build cmake before musl toolchain, as we replace the compiler during that step. +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" \ + CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \ + REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build + +COPY scripts/sccache.sh /scripts/ +RUN sh /scripts/sccache.sh + +ENV HOSTS=x86_64-unknown-linux-musl + +ENV RUST_CONFIGURE_ARGS \ + --musl-root-x86_64=/usr/local/x86_64-linux-musl \ + --enable-extended \ + --enable-sanitizers \ + --enable-profiler \ + --enable-lld \ + --set target.x86_64-unknown-linux-musl.crt-static=false \ + --build $HOSTS + +# Newer binutils broke things on some vms/distros (i.e., linking against +# unknown relocs disabled by the following flag), so we need to go out of our +# way to produce "super compatible" binaries. +# +# See: https://github.com/rust-lang/rust/issues/34978 +# And: https://github.com/rust-lang/rust/issues/59411 +ENV CFLAGS_x86_64_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none \ + -Wl,--compress-debug-sections=none" + +# To run native tests replace `dist` below with `test` +ENV SCRIPT python3 ../x.py dist --build $HOSTS |