separateDebugInfo: Use --strip-unneeded

According to https://stackoverflow.com/q/46197810/115030,
--only-keep-debug preserves all the information stripped by
--strip-unneeded.  This reduces the size of the webkitgtk output by 22%
(123 MB → 96 MB).

Inspired by #159612.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2022-02-15 20:00:14 -08:00
parent 4bb779294e
commit d652556758

View File

@ -34,7 +34,7 @@ _separateDebugInfo() {
# firmware blobs in QEMU.)
(
$OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
$STRIP --strip-debug "$i"
$STRIP --strip-unneeded "$i"
# Also a create a symlink <original-name>.debug.
ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"