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 https://github.com/Electron-Cash/Electron-Cash/commit/43aaf9572f822b977ecffe68f9cce428e5d27c18
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user