From 1f0e8fd1317117dabf0d2e35b636dfb39e382d74 Mon Sep 17 00:00:00 2001 From: nickclifton <31441682+nickclifton@users.noreply.github.com> Date: Wed, 19 Jun 2019 12:45:09 +0100 Subject: Add step to find-debuginfo.sh script to compress annobin notes. With the introduction of the annobin gcc plugin to the build process, built binary files have become larger. Sometimes significantly so. This is a patch that adds a new step to the post-link process performed by rpmbuild, to run the objcopy program with the --merge-notes option specified. This will reduce the size of the annobin notes in binary files, thus alleviating the size growth. (cherry picked from commit cc1965ce3acaa7d9356b7671050a15e2cda2f424) --- scripts/find-debuginfo.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index c16299600..d837a6b4b 100755 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -388,6 +388,10 @@ do_file() fi fi + # Compress any annobin notes in the original binary. + # Ignore any errors, since older objcopy don't support --merge-notes. + objcopy --merge-notes "$f" 2>/dev/null || true + # A binary already copied into /usr/lib/debug doesn't get stripped, # just has its file names collected and adjusted. case "$dn" in -- cgit v1.2.1