From: Yauheni Kaliuta <ykaliuta(a)redhat.com>
spec: keep .BTF section in modules for s390
Bugzilla:
https://bugzilla.redhat.com/2071969
The patch 6a8653ed6b34 ("spec: Keep .BTF section in modules")
introduced possibility to keep .BTF sections which is necessary for
CONFIG_DEBUG_INFO_BTF option.
At that time s390 architecture had a problem (see the 6a8653ed6b34
commit message), which was later fixed with efdd3eb8015e ("libbpf:
Accommodate DWARF/compiler bug with duplicated structs").
c446fdacb10d ("bpf: fix register_btf_kfunc_id_set for
!CONFIG_DEBUG_INFO_BTF") made such modules unloadable.
The patch removes the workaround since it's not needed anymore.
Signed-off-by: Yauheni Kaliuta <ykaliuta(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -413,11 +413,6 @@ Summary: The Linux kernel
%define with_zfcpdump 0
%endif
-# skip BTF in kernel modules for s390x
-%ifnarch s390x
-%define with_kmod_btf --keep-section '.BTF'
-%endif
-
%if 0%{?fedora}
# This is not for Fedora
%define with_zfcpdump 0
@@ -1121,7 +1116,7 @@ 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} %{?with_kmod_btf} -p
'.*\/usr\/src\/kernels/.*|XXX' -o ignored-debuginfo.list -p
'/.*/%%{KVERREL_RE}%{?1:[+]%{1}}/.*|/.*%%{KVERREL_RE}%{?1:\+%{1}}(\.debug)?' -o
debuginfo%{?1}.list}\
+%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} --keep-section
'.BTF' -p '.*\/usr\/src\/kernels/.*|XXX' -o ignored-debuginfo.list -p
'/.*/%%{KVERREL_RE}%{?1:[+]%{1}}/.*|/.*%%{KVERREL_RE}%{?1:\+%{1}}(\.debug)?' -o
debuginfo%{?1}.list}\
%{nil}
#
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1751