-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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[1]. 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). [1]: https://www.openwall.com/lists/musl/2021/10/21/2
- Loading branch information
1 parent
07acdb4
commit e97317c
Showing
5 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/configure b/configure | ||
index 86801281..ed2f7998 100755 | ||
--- a/configure | ||
+++ b/configure | ||
@@ -398,7 +398,7 @@ test "$debug" = yes && CFLAGS_AUTO=-g | ||
# | ||
printf "checking whether we should preprocess assembly to add debugging information... " | ||
if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" && | ||
- test -f "tools/add-cfi.$ARCH.awk" && | ||
+ test -f "$srcdir/tools/add-cfi.$ARCH.awk" && | ||
printf ".file 1 \"srcfile.s\"\n.line 1\n.cfi_startproc\n.cfi_endproc" | $CC -g -x assembler -c -o /dev/null 2>/dev/null - | ||
then | ||
ADD_CFI=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters