richardphibel / rpms / rpm

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