Browse Source

AppImage: Improve binary stripping

Slightly reduces file size, improves build speed and makes build more
reproducible.

The .comment section contained GCC version information which could cause
different build output from just a minor update in GCC. The information is not
needed so we strip this.

The strip command was invoked using xargs, spawning a new process for each file.
This is inefficient as xargs can correctly run the strip command with multiple
file names.

-----

taken from 43aaf9572f
hard-fail-on-bad-server-string
Axel Gembe 5 years ago
committed by SomberNight
parent
commit
880bd16883
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      contrib/build-linux/appimage/build.sh

3
contrib/build-linux/appimage/build.sh

@ -178,13 +178,14 @@ info "Copying additional libraries"
info "stripping binaries from debug symbols."
# "-R .note.gnu.build-id" also strips the build id
# "-R .comment" also strips the GCC version information
strip_binaries()
{
chmod u+w -R "$APPDIR"
{
printf '%s\0' "$APPDIR/usr/bin/python3.6"
find "$APPDIR" -type f -regex '.*\.so\(\.[0-9.]+\)?$' -print0
} | xargs -0 --no-run-if-empty --verbose -n1 strip -R .note.gnu.build-id
} | xargs -0 --no-run-if-empty --verbose strip -R .note.gnu.build-id -R .comment
}
strip_binaries

Loading…
Cancel
Save