malmond / rpms / rpm

Forked from rpms/rpm 4 years ago
Clone

Blame SOURCES/0001-Add-step-to-find-debuginfo.sh-script-to-compress-ann.patch

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