about summary refs log tree commit diff
path: root/src/ci/docker/host-x86_64
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-11-16 23:58:21 +0100
committerGitHub <noreply@github.com>2021-11-16 23:58:21 +0100
commit3b0249b1c95cd4e907f770fff2b4aed6d43e2fe5 (patch)
treefc5a07e0c735c8cc7ea6cbfe1d7e209f71630dd2 /src/ci/docker/host-x86_64
parentd914f17ca71a33a89b2dc3436fca51b1a091559e (diff)
parente97317c2d39689f1c7d53e8b3af64643ed5574c9 (diff)
downloadrust-3b0249b1c95cd4e907f770fff2b4aed6d43e2fe5.tar.gz
rust-3b0249b1c95cd4e907f770fff2b4aed6d43e2fe5.zip
Rollup merge of #90733 - wesleywiser:musl_debuginfo, r=Mark-Simulacrum
Build musl dist artifacts with debuginfo enabled

Since our musl targets link to a version of musl we build and bundle
with the targets, if users need to debug into musl or generate
backtraces which contain parts of the musl library, they will be unable
to do so unless we enable and ship the debug info.

This patch changes our dist builds so they enabled debug info when
building musl. This patch also includes a fix for CFI detection in
musl's `configure` script which has been [posted upstream](https://www.openwall.com/lists/musl/2021/10/21/2).

The net effect of this is that we now ship debug info for musl in those
targets. This adds ~90kb to those artifacts but running `strip` on
binaries produced removes all of that. For a "hello world" Rust binary
on x86_64, the numbers are:

|                        | debug | release | release + strip |
|           -            |   -   |    -    |        -        |
| without musl debuginfo | 507kb |  495kb  |      410kb      |
| with musl debuginfo    | 595kb | 584kb | 410kb |

Once stripped, the final binaries are the same size (down to the byte).

Fixes #90103

r? `@Mark-Simulacrum`
Diffstat (limited to 'src/ci/docker/host-x86_64')
-rw-r--r--src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile1
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile1
-rw-r--r--src/ci/docker/host-x86_64/test-various/Dockerfile1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile
index 1be3fecd88f..61cc000dca5 100644
--- a/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile
@@ -8,6 +8,7 @@ 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" \
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
index ea70771a570..ef49904b53d 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-musl/Dockerfile
@@ -24,6 +24,7 @@ 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" \
diff --git a/src/ci/docker/host-x86_64/test-various/Dockerfile b/src/ci/docker/host-x86_64/test-various/Dockerfile
index 4d4953fa0e2..4d554a2852a 100644
--- a/src/ci/docker/host-x86_64/test-various/Dockerfile
+++ b/src/ci/docker/host-x86_64/test-various/Dockerfile
@@ -22,6 +22,7 @@ RUN curl -sL https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-x64.tar.xz | \
   tar -xJ
 
 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 /