summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaura Abbott <labbott@redhat.com>2019-11-06 13:15:08 -0500
committerLaura Abbott <labbott@redhat.com>2019-11-13 10:01:45 -0500
commitbd2450b71d7fd14a9911bfe68b2036087dd5d388 (patch)
treea027e18a27a384af380eeae2a8cec8ccbb0a7b20
parentac4c8ecc59a9784123e4e56863cea195b2718f77 (diff)
downloadkernel-bd2450b71d7fd14a9911bfe68b2036087dd5d388.tar.gz
kernel-bd2450b71d7fd14a9911bfe68b2036087dd5d388.tar.xz
kernel-bd2450b71d7fd14a9911bfe68b2036087dd5d388.zip
Be smarter about getting rid of debuginfo
We've been doing a workaround of using a uuid for the build-id for userspace binaries to let us get parallel debuginfo (the trick we use for the kernel doesn't extend to userspace binaries). This works but isn't ideal for reproducibility. Given we don't actually care about this debuginfo, just remove it from the buildroot completely.
-rw-r--r--kernel.spec13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel.spec b/kernel.spec
index bb0d749f2..8495d29bf 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -930,6 +930,11 @@ Enterprise Linux kernel, suitable for the kabi-dw tool.
# This macro creates a kernel-<subpackage>-debuginfo package.
# %%kernel_debuginfo_package <subpackage>
#
+# Explanation of the find_debuginfo_opts: We build multiple kernels (debug
+# pae etc.) so the regex filters those kernels appropriately. We also
+# have to package several binaries as part of kernel-devel but getting
+# unique build-ids is tricky for these userspace binaries. We don't really
+# care about debugging those so we just filter those out and remove it.
%define kernel_debuginfo_package() \
%package %{?1:%{1}-}debuginfo\
Summary: Debug information for package %{name}%{?1:-%{1}}\
@@ -940,7 +945,9 @@ AutoReqProv: no\
%description %{?1:%{1}-}debuginfo\
This package provides debug information for package %{name}%{?1:-%{1}}.\
This is required to use SystemTap with %{name}%{?1:-%{1}}-%{KVERREL}.\
-%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '/.*/%%{KVERREL_RE}%{?1:[+]%{1}}/.*|/.*%%{KVERREL_RE}%{?1:\+%{1}}(\.debug)?' -o debuginfo%{?1}.list}\
+%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*\/usr\/src\/kernels/.*|XXX' -o ignored-debuginfo.list -p '/.*/%%{KVERREL_RE}%{?1:[+]%{1}}/.*|/.*%%{KVERREL_RE}%{?1:\+%{1}}(\.debug)?' -o debuginfo%{?1}.list}\
+
+
%{nil}
#
@@ -1464,7 +1471,7 @@ cp_vmlinux()
# flags cause issues with the host compiler.
%if !%{with_cross}
%define build_hostcflags %{?build_cflags}
-%define build_hostldflags %{?build_ldflags} -Wl,--build-id=uuid
+%define build_hostldflags %{?build_ldflags}
%endif
%define make make %{?cross_opts} %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"
@@ -2099,11 +2106,13 @@ find Documentation -type d | xargs chmod u+w
# We don't want to package debuginfo for self-tests and samples but
# we have to delete them to avoid an error messages about unpackaged
# files.
+# Delete the debuginfo for for kernel-devel files
%define __remove_unwanted_dbginfo_install_post \
if [ "%{with_selftests}" -ne "0" ]; then \
rm -rf $RPM_BUILD_ROOT/usr/lib/debug/usr/libexec/ksamples; \
rm -rf $RPM_BUILD_ROOT/usr/lib/debug/usr/libexec/kselftests; \
fi \
+ rm -rf $RPM_BUILD_ROOT/usr/lib/debug/usr/src; \
%{nil}
#