From 059d945f6e1da762761b7490fca2929b0f28b7c5 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 26 Jun 2022 01:03:11 +0200 Subject: [PATCH] 0.14-4 Add dwz-0.14-binutils-Wn.patch --- .gitignore | 1 + dwz-0.14-binutils-Wn.patch | 80 ++++++++++++++++++++++++++++++++++++++ dwz.spec | 10 ++++- 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 dwz-0.14-binutils-Wn.patch diff --git a/.gitignore b/.gitignore index 6577e4f..613e2b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/dwz /dwz-0.3.tar.bz2 /dwz-0.4.tar.bz2 /dwz-0.5.tar.bz2 diff --git a/dwz-0.14-binutils-Wn.patch b/dwz-0.14-binutils-Wn.patch new file mode 100644 index 0000000..f9f3c2f --- /dev/null +++ b/dwz-0.14-binutils-Wn.patch @@ -0,0 +1,80 @@ +commit b1f26dc76158e1f3364836d8b540b17a7a1ccb3d +Author: Tom de Vries +Date: Sat Mar 20 09:37:31 2021 +0100 + + [testsuite] Handle readelf following links by default + + Since binutils commit c46b706620e "Change the readelf and objdump programs so + that they will automatically follow links to separate debug info files" there + are a few FAILs in the dwz testsuite. + + This is just due to changing the default behaviour for readelf. + + Fix this by testing whether the new -Wn readelf flag is supported, + and if so, adding it to the readelf call. + + 2021-03-20 Tom de Vries + + PR dwz/27592 + * testsuite/dwz.tests/odr-struct-multifile.sh: Call readelf with -wN + if supported. + * testsuite/dwz.tests/cycle.sh: Same. + +diff --git a/testsuite/dwz.tests/odr-struct-multifile.sh b/testsuite/dwz.tests/odr-struct-multifile.sh +index cc462c9..20b682b 100644 +--- a/testsuite/dwz.tests/odr-struct-multifile.sh ++++ b/testsuite/dwz.tests/odr-struct-multifile.sh +@@ -2,6 +2,11 @@ if ! $execs/dwz-for-test --odr -v 2>/dev/null; then + exit 77 + fi + ++readelf_flags="" ++if readelf -h 2>&1 | grep -q "\-wN,"; then ++ readelf_flags=-wN ++fi ++ + cp $execs/odr-struct 1 + cp 1 2 + +@@ -41,12 +46,12 @@ done + + + for name in aaa bbb ccc; do +- cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true) ++ cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true) + [ $cnt -eq 0 ] + done + + for name in member_one member_two member_three member_four; do +- cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true) ++ cnt=$(readelf -wi $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true) + [ $cnt -eq 0 ] + done + +commit 2b3711fef3438ca83db8eabed3715b6c45924511 +Author: Lv Ying via Dwz +Date: Thu Jan 13 05:29:44 2022 +0800 + + fix Handle readelf following links by default(b1f26dc76158e) + + The two testcases still failed when using newer readelf(binutils commit c46b706620e): + testsuite/dwz.tests/odr-struct-multifile.sh + testsuite/dwz.tests/cycle.sh + + fix the new -Wn readelf flag test + + Signed-off-by: Lv Ying + +diff --git a/testsuite/dwz.tests/odr-struct-multifile.sh b/testsuite/dwz.tests/odr-struct-multifile.sh +index 20b682b..159cbc3 100644 +--- a/testsuite/dwz.tests/odr-struct-multifile.sh ++++ b/testsuite/dwz.tests/odr-struct-multifile.sh +@@ -3,7 +3,7 @@ if ! $execs/dwz-for-test --odr -v 2>/dev/null; then + fi + + readelf_flags="" +-if readelf -h 2>&1 | grep -q "\-wN,"; then ++if readelf -h 2>&1 | grep -q "\-wN"; then + readelf_flags=-wN + fi + diff --git a/dwz.spec b/dwz.spec index fd8156c..25d45e3 100644 --- a/dwz.spec +++ b/dwz.spec @@ -1,12 +1,15 @@ Summary: DWARF optimization and duplicate removal tool Name: dwz Version: 0.14 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and GPLv3+ Source: %{name}-0.14.tar.xz BuildRequires: gcc, gcc-c++, gdb, elfutils-libelf-devel, dejagnu BuildRequires: make +# Patches +Patch1: dwz-0.14-binutils-Wn.patch + %description The dwz package contains a program that attempts to optimize DWARF debugging information contained in ELF shared libraries and ELF executables @@ -17,7 +20,7 @@ DW_TAG_partial_unit compilation units (CUs) for duplicated information and using DW_TAG_imported_unit to import it into each CU that needs it. %prep -%setup -q -n dwz +%autosetup -p1 -n dwz %build %make_build CFLAGS='%{optflags}' LDFLAGS='%{build_ldflags}' \ @@ -36,6 +39,9 @@ make check %{_mandir}/man1/dwz.1* %changelog +* Sat Jun 26 2021 Mark Wielaard 0.14-4 +- Add dwz-0.14-binutils-Wn.patch + * Thu Jan 20 2022 Fedora Release Engineering - 0.14-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild