Bug 1661508 - glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries [rhel-7.7]
Summary: glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries ...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.7
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: qe-baseos-tools-bugs
: 1982316 (view as bug list)
Depends On: 1661510 1663264
Blocks: 1655768 1982316
TreeView+ depends on / blocked
Reported: 2018-12-21 12:12 UTC by Florian Weimer
Modified: 2021-07-16 14:16 UTC (History)
12 users (show)

Fixed In Version: glibc-2.17-290.el7
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1661510 1980650 1982316 1982317 (view as bug list)
Last Closed: 2019-08-06 12:49:40 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2118 0 None None None 2019-08-06 12:49:54 UTC

Internal Links: 1540653

Description Florian Weimer 2018-12-21 12:12:27 UTC
The fix for bug 1540653 has the side effect that binaries are no longer stripped because glibc.spec uses the -g option.  This adds a measurable overhead to the packages.

We need to fix this in some way, if necessary by calling strip explicitly.

This issue did not effect the glibc binaries in Red Hat Enterprise Linux 7.6 because those were built with an rpm version that did not contain the changes for bug 1540653.

Comment 2 Florian Weimer 2019-01-03 14:58:20 UTC
I tried to restore the old behavior with the current find-debuginfo.sh script, with a change like this:

diff --git a/glibc.spec b/glibc.spec
index 5a388aed..6bb329bc 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -3692,16 +3692,26 @@ ls -l $RPM_BUILD_ROOT/usr/bin/getconf
 ls -l $RPM_BUILD_ROOT/usr/libexec/getconf
 eu-readelf -hS $RPM_BUILD_ROOT/usr/bin/getconf $RPM_BUILD_ROOT/usr/libexec/getconf/*
-find_debuginfo_args='--strict-build-id -g'
 %ifarch %{debuginfocommonarches}
-find_debuginfo_args="$find_debuginfo_args \
+# glibc-common contains no libraries, so everything can be stripped
+# (no -g).
+bash /usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args \
   -l common.filelist -l utils.filelist -l nscd.filelist \
-  -p '.*/(sbin|libexec)/.*' \
-  -o debuginfocommon.filelist \
-  -l rpm.filelist -l nosegneg.filelist \
+  -o debuginfocommon.filelist
-eval /usr/lib/rpm/find-debuginfo.sh "$find_debuginfo_args" -o debuginfo.filelist
+# For the glibc package, we must only use -g for the main libraries.
+grep -hE "$lib_pattern" rpm.filelist nosegneg.filelist \
+  > libonly-rpm.filelist
+grep -hEv "$lib_pattern" rpm.filelist nosegneg.filelist \
+  > nolib-rpm.filelist
+bash /usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args -g \
+  -o libonly-debuginfo.filelist -l libonly-rpm.filelist
+bash /usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args \
+  -o nolib-debuginfo.filelist -l nolib-rpm.filelist
+cat libonly-debuginfo.filelist nolib-debuginfo.filelist > debuginfo.filelist
 # List all of the *.a archives in the debug directory.

But I don't think invoking the script multiple times like this will work because find-debuginfo.sh is really designed to process all files and then handle the -l split afterwards.

Comment 5 Florian Weimer 2019-04-02 11:37:54 UTC
Fixed with this patch:

diff --git a/glibc.spec b/glibc.spec
index d950a2a5..85bc411f 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1677,6 +1677,9 @@ BuildRequires: systemd
 # the required semantics.
 BuildRequires: gcc >= 4.8.5-25
+# This RPM version introduced --g-libs.
+BuildRequires: rpm-build >= 4.11.3-38.el7
 %define enablekernel 2.6.32
 Conflicts: kernel < %{enablekernel}
 %define target %{_target_cpu}-redhat-linux
@@ -3812,7 +3815,7 @@ ls -l $RPM_BUILD_ROOT/usr/bin/getconf
 ls -l $RPM_BUILD_ROOT/usr/libexec/getconf
 eu-readelf -hS $RPM_BUILD_ROOT/usr/bin/getconf $RPM_BUILD_ROOT/usr/libexec/getconf/*
-find_debuginfo_args='--strict-build-id -g'
+find_debuginfo_args='--strict-build-id --g-libs'
 %ifarch %{debuginfocommonarches}
 find_debuginfo_args="$find_debuginfo_args \
   -l common.filelist -l utils.filelist -l nscd.filelist \

Comment 7 Sergey Kolosov 2019-06-14 09:41:11 UTC

glibc-2.17-290.el7 contains stripped binaries, it also produces stripped binaries during rpmbuild -bb

Comment 9 errata-xmlrpc 2019-08-06 12:49:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Comment 13 Carlos O'Donell 2021-07-15 19:52:44 UTC
*** Bug 1982316 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.