From: Victor Erminpour Date: Wed, 25 Jul 2018 16:38:51 +0000 (-0700) Subject: uek-rpm: Enable perf stripped binary X-Git-Tag: v4.1.12-124.31.3~564 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=934a4937c99fbd63ab4d29082397bd2ad3779cf7;p=users%2Fjedix%2Flinux-maple.git uek-rpm: Enable perf stripped binary Due to a bug in the find-debuginfo.sh file provided by RPM, the perf binary was not properly stripped in OL7. This commit provides a new patch, and cleans up previous patches to find-debuginfo.sh. Orabug: 27801171 Signed-off-by: Victor Erminpour Reviewed-by: Dan Duval Signed-off-by: Brian Maly --- diff --git a/uek-rpm/ol6/find-debuginfo.sh.ol6.diff b/uek-rpm/ol6/find-debuginfo.sh.ol6.diff new file mode 100644 index 0000000000000..a0f0cf4d6fa71 --- /dev/null +++ b/uek-rpm/ol6/find-debuginfo.sh.ol6.diff @@ -0,0 +1,11 @@ +--- find-debuginfo.sh.orig 2018-07-24 16:56:39.078515151 -0700 ++++ find-debuginfo.sh 2018-07-24 16:56:46.757431723 -0700 +@@ -198,7 +198,7 @@ make_id_link() + get_debugfn() + { + dn=$(dirname "${1#$RPM_BUILD_ROOT}") +- bn=$(basename "$1" .debug).debug ++ bn=$(basename "$1").debug + + debugdn=${debugdir}${dn} + debugfn=${debugdn}/${bn} diff --git a/uek-rpm/ol6/kernel-uek.spec b/uek-rpm/ol6/kernel-uek.spec index 7617eeb9401c5..18b93ebda9749 100644 --- a/uek-rpm/ol6/kernel-uek.spec +++ b/uek-rpm/ol6/kernel-uek.spec @@ -575,10 +575,8 @@ Source200: kabi_whitelist_x86_64debug Source201: kabi_whitelist_x86_64 Source202: ksplice_signing_key.x509 -#Source300: debuginfo-g1.diff -#Source301: debuginfo-g1-minusr-old-elfutils.diff - Source300: debuginfo-g1.diff +Source301: find-debuginfo.sh.ol6.diff # Here should be only the patches up to the upstream canonical Linus tree. @@ -993,7 +991,8 @@ ApplyPatch %{stable_patch_01} # to support -g1. (This is a patch of *RPM*, not of the kernel, # so it is not governed by nopatches.) cp %{_rpmconfigdir}/find-debuginfo.sh %{_builddir} -patch %{_builddir}/find-debuginfo.sh %{SOURCE300} +patch %{_builddir}/find-debuginfo.sh %{SOURCE300} && \ +patch %{_builddir}/find-debuginfo.sh %{SOURCE301} chmod +x %{_builddir}/find-debuginfo.sh # only deal with configs if we are going to build for the arch diff --git a/uek-rpm/ol7/debuginfo-g1-minusr-old-elfutils.diff b/uek-rpm/ol7/debuginfo-g1-minusr-old-elfutils.diff deleted file mode 100644 index 312608182bcfc..0000000000000 --- a/uek-rpm/ol7/debuginfo-g1-minusr-old-elfutils.diff +++ /dev/null @@ -1,58 +0,0 @@ ---- find-debuginfo.sh.orig 2012-09-12 20:42:13.106294407 +0100 -+++ find-debuginfo.sh 2012-09-12 20:49:52.496863002 +0100 -@@ -2,12 +2,14 @@ - #find-debuginfo.sh - automagically generate debug info and file list - #for inclusion in an rpm spec file. - # --# Usage: find-debuginfo.sh [--strict-build-id] [-g] -+# Usage: find-debuginfo.sh [--strict-build-id] [-g|-g1] - # [-o debugfiles.list] - # [[-l filelist]... [-p 'pattern'] -o debuginfo.list] - # [builddir] - # - # The -g flag says to use strip -g instead of full strip on DSOs. -+# The -g1 flag says to use strip -g instead of full strip on -+# everything, DSO or not. - # The --strict-build-id flag says to exit with failure status if - # any ELF binary processed fails to contain a build-id note. - # -@@ -36,6 +38,9 @@ - --strict-build-id) - strict=true - ;; -+ -g1) -+ strip_g=full -+ ;; - -g) - strip_g=true - ;; -@@ -88,11 +93,25 @@ - - strip_to_debug() - { -- local g= -- $strip_g && case "$(file -bi "$2")" in -- application/x-sharedlib*) g=-g ;; -+ local use_objcopy=false -+ case "$strip_g" in -+ true) case "$(file -bi "$2")" in -+ application/x-sharedlib*) use_objcopy=true ;; -+ esac;; -+ full) use_objcopy=true;; - esac -- eu-strip --remove-comment $g -f "$1" "$2" || exit -+ # Note: eu-strip fails to remove debugging info in files containing -+ # debugging relocations at present. objcopy works fine, so use that. -+ # (This does mean that .comment sections don't get stripped, but this -+ # seems an insignificant problem for now. When elfutils is fixed this -+ # hack can be removed.) -+ if $use_objcopy; then -+ objcopy --only-keep-debug "$2" "$1" || exit -+ objcopy --strip-debug "$2" "$2.tmp" || exit -+ mv -f "$2.tmp" "$2" || exit -+ else -+ eu-strip --remove-comment -f "$1" "$2" || exit -+ fi - chmod 444 "$1" || exit - } - diff --git a/uek-rpm/ol7/find-debuginfo.sh.ol7.diff b/uek-rpm/ol7/find-debuginfo.sh.ol7.diff new file mode 100644 index 0000000000000..77601e9dcfdf5 --- /dev/null +++ b/uek-rpm/ol7/find-debuginfo.sh.ol7.diff @@ -0,0 +1,11 @@ +--- find-debuginfo.sh.orig 2018-07-24 17:02:40.729585967 -0700 ++++ find-debuginfo.sh 2018-07-24 17:02:49.985485405 -0700 +@@ -266,7 +266,7 @@ make_id_link() + get_debugfn() + { + dn=$(dirname "${1#$RPM_BUILD_ROOT}") +- bn=$(basename "$1" .debug).debug ++ bn=$(basename "$1").debug + + debugdn=${debugdir}${dn} + debugfn=${debugdn}/${bn} diff --git a/uek-rpm/ol7/kernel-uek.spec b/uek-rpm/ol7/kernel-uek.spec index 76a235a7d4787..f11015c25ac2f 100644 --- a/uek-rpm/ol7/kernel-uek.spec +++ b/uek-rpm/ol7/kernel-uek.spec @@ -570,7 +570,7 @@ Source201: kabi_whitelist_x86_64 Source202: ksplice_signing_key.x509 Source300: debuginfo-g1.diff -Source301: debuginfo-g1-minusr-old-elfutils.diff +Source301: find-debuginfo.sh.ol7.diff # Here should be only the patches up to the upstream canonical Linus tree. @@ -985,9 +985,8 @@ ApplyPatch %{stable_patch_01} # to support -g1. (This is a patch of *RPM*, not of the kernel, # so it is not governed by nopatches.) cp %{_rpmconfigdir}/find-debuginfo.sh %{_builddir} -patch %{_builddir}/find-debuginfo.sh %{SOURCE300} || \ - { mv -f %{_builddir}/find-debuginfo.sh.orig %{_builddir}/find-debuginfo.sh && \ - patch %{_builddir}/find-debuginfo.sh %{SOURCE301}; } +patch %{_builddir}/find-debuginfo.sh %{SOURCE300} && \ +patch %{_builddir}/find-debuginfo.sh %{SOURCE301} chmod +x %{_builddir}/find-debuginfo.sh # only deal with configs if we are going to build for the arch