Sync from SUSE:SLFO:Main dwz revision cb4f07ce9c36c3f60fcf7bb1a6ac191a

This commit is contained in:
Adrian Schröter 2024-05-03 12:15:12 +02:00
commit 0753ba1ab7
9 changed files with 578 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>testsuite</package>
</multibuild>

BIN
dwz-0.15.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
diff --git a/args.c b/args.c
index e93c24d..3e1113f 100644
--- a/args.c
+++ b/args.c
@@ -66,7 +66,7 @@ int gen_cu_p = 0;
enum die_count_methods die_count_method = estimate;
-int odr = 0;
+int odr = 1;
enum odr_mode odr_mode = ODR_LINK;
/* Filename if inter-file size optimization should be performed. */
@@ -202,7 +202,7 @@ static struct option_help dwz_common_options_help[] =
"Don't optimize files larger than this limit." },
{ NULL, "odr", NULL, NULL,
NULL },
- { NULL, "no-odr", NULL, "Disabled",
+ { NULL, "no-odr", NULL, "Enabled",
"Enable/disable one definition rule optimization." },
{ NULL, "odr-mode", "<basic|link>", "link",
"Set aggressiveness level of one definition rule optimization." },
diff --git a/dwz.1 b/dwz.1
index 1cff329..f3cd3dd 100644
--- a/dwz.1
+++ b/dwz.1
@@ -133,7 +133,7 @@ considered equal. This has the effect that DIEs referring to distinct DIEs
representing the same type (like f.i. pointer type DIEs) are considered equal,
and may be deduplicated. The status of this optimization is experimental.
It's disabled in low-mem mode.
-Disabled by default.
+Enabled by default.
.TP
.B \-\-odr-mode=<basic|link>
Set the One-Definition-Rule optimization aggressiveness: basic or link.

View File

@ -0,0 +1,67 @@
diff --git a/testsuite/dwz.tests/odr-struct-multifile.sh b/testsuite/dwz.tests/odr-struct-multifile.sh
deleted file mode 100755
index 5961abf..0000000
--- a/testsuite/dwz.tests/odr-struct-multifile.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-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
-
-for name in aaa bbb ccc; do
- cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true)
- [ $cnt -eq 2 ]
-done
-
-for name in member_one member_two member_three member_four; do
- cnt=$(readelf -wi 1 | grep -c "DW_AT_name.*:.*$name" || true)
- case $name in
- member_one|member_two)
- [ $cnt -eq 2 ]
- ;;
- member_three|member_four)
- [ $cnt -eq 1 ]
- ;;
- esac
-done
-
-decl_cnt=$(readelf -wi 1 | grep -c "DW_AT_declaration" || true)
-
-$execs/dwz-for-test --odr 1 2 -m 3
-
-verify-dwarf.sh 1
-verify-dwarf.sh 3
-
-for name in aaa bbb ccc; do
- cnt=$(readelf -wi 3 | grep -c "DW_AT_name.*:.*$name" || true)
- [ $cnt -eq 1 ]
-done
-
-for name in member_one member_two member_three member_four; do
- cnt=$(readelf -wi 3 | grep -c "DW_AT_name.*:.*$name" || true)
- [ $cnt -eq 1 ]
-done
-
-# Even with -wN readelf 2.38-15.fc37 follows and prints the contents
-# of the alt file. So make sure it cannot do that by removing it.
-rm 3
-
-for name in aaa bbb ccc; do
- 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 $readelf_flags 1 | grep -c "DW_AT_name.*:.*$name" || true)
- [ $cnt -eq 0 ]
-done
-
-rm -f 1 2 3

25
dwz-rpmlintrc Normal file
View File

@ -0,0 +1,25 @@
# The package should _not_ be noarch, testresults differ from architecture
# to architecture.
addFilter("dwz-testsuite.* no-binary")
# The rpmlint warning is:
# dwz-testsuite.nosrc: W: invalid-spec-name
# The spec file name (without the .spec suffix) must match the package name
# ("Name:" tag). Either rename your package or the specfile.
# This seems to be a multibuild artifact. The package name is dwz-testsuite,
# but the specfile filename is dwz.spec. The only way we can fix this is by
# reverting to a two-specfile setup.
#
# FTR, the warning comes paired with these grep failures in the "Preparing
# packages log":
# ... testing for empty debuginfo packages
# grep: SOURCES/dwz-testsuite.spec: No such file or directory
# ... running 50-check-filelist
# ...
# ... testing devel dependencies required by libtool .la files
# grep: SOURCES/dwz-testsuite.spec: No such file or directory
# (can be skipped by "skip-check-libtool-deps" anywhere in spec)
# ... running 50-check-packaged-twice
#
# So, skip the rpmlint warning. This doesn't fix the grep fails.
addFilter("dwz-testsuite.* invalid-spec-name")

265
dwz.changes Normal file
View File

@ -0,0 +1,265 @@
-------------------------------------------------------------------
Sun Nov 20 16:04:19 UTC 2022 - Bernhard Wiedemann <bwiedemann@suse.com>
- Make PGO training independent from number of build machine cores
(boo#1040589)
-------------------------------------------------------------------
Mon Nov 7 08:09:38 UTC 2022 - Martin Liška <mliska@suse.cz>
- Update to 0.15 release:
* Uses xxHash hashing algorithm. A 8% ~ 14% speedup.
* Set endianity of multifile using -e, --multifile-endian.
* Set pointer size of multifile using -p, --multifile-pointer-size
* Process files in parallel using -j N --jobs N. The default is
processors / 2. Disabled when multifile is used.
* Prints abbrev or DIE offset for Unknown DWARF error messages.
* All testcases have been updated to work against the binutils 2.39.
- Remove upstreamed patches:
* dwz-fix-another-reference-from-pu-to-cu-for-odr.patch
* dwz-handle-reordered-dup-chains-in-create-import-tree.patch
* dwz-testsuite-fix-pr27463.sh-on-riscv64.patch
* dwz-use-grep-E-instead-of-egrep.patch
- Rebased patches:
* dwz-remove-odr-struct-multifile.sh.patch
* dwz-enable-odr-by-default.patch
-------------------------------------------------------------------
Thu Sep 8 17:53:27 UTC 2022 - Martin Liška <mliska@suse.cz>
- Add dwz-use-grep-E-instead-of-egrep.patch in order
to fix build with latest grep package.
-------------------------------------------------------------------
Thu Apr 28 10:08:03 UTC 2022 - Martin Liška <mliska@suse.cz>
- Drop binutils-gold dependency for testsuite as binutils-gold
is deprecated and will be removed in the future.
-------------------------------------------------------------------
Wed Feb 2 09:20:10 UTC 2022 - Martin Liška <mliska@suse.cz>
- Silent warnings for tramp3d compilation.
-------------------------------------------------------------------
Wed Jan 5 06:20:01 UTC 2022 - Martin Liška <mliska@suse.cz>
- Add dwz-remove-odr-struct-multifile.sh.patch that removes problematic
testcase.
-------------------------------------------------------------------
Thu Dec 23 10:59:49 UTC 2021 - Martin Liška <mliska@suse.cz>
- Start using -O3 and PGO with tramp3d as training binary.
-------------------------------------------------------------------
Wed Mar 17 15:54:22 UTC 2021 - Tom de Vries <tdevries@suse.com>
- Backport fixes for odr PR [swo#27578]:
* dwz-fix-another-reference-from-pu-to-cu-for-odr.patch
* dwz-handle-reordered-dup-chains-in-create-import-tree.patch
- Backport testsuite fix:
* dwz-testsuite-fix-pr27463.sh-on-riscv64.patch
-------------------------------------------------------------------
Wed Mar 17 15:38:20 UTC 2021 - Tom de Vries <tdevries@suse.com>
- DWZ 0.14 update:
* Dropped patches:
- dwz-add-assert-checking-that-cu-is-not-referenced-from-pu.patch
- dwz-call-reorder_dups-asap.patch
- dwz-document-experimental-status-of-odr.patch
- dwz-fix-reference-of-pu-to-cu-for-odr.patch
- dwz-precompute-partitions.patch
- dwz-testsuite-fix-pr25109.sh-on-riscv64.patch
- dwz-update-suse-copyright-years.patch
- dwz-update-version.patch
* Updated patch:
- dwz-enable-odr-by-default.patch
-------------------------------------------------------------------
Fri Feb 26 12:07:30 UTC 2021 - Tom de Vries <tdevries@suse.com>
- Change Version tag from 0.14rc1 to 0.14~rc1
* Rename dwz-0.14rc1.tar.xz to dwz-0.14~rc1.tar.xz
-------------------------------------------------------------------
Fri Feb 26 09:31:00 UTC 2021 - Tom de Vries <tdevries@suse.com>
- Fix testsuite build fail on riscv64:
* dwz-testsuite-fix-pr25109.sh-on-riscv64.patch
-------------------------------------------------------------------
Fri Feb 26 08:38:53 UTC 2021 - Tom de Vries <tdevries@suse.com>
- Update reported dwz version
* dwz-update-version.patch
-------------------------------------------------------------------
Fri Feb 26 07:52:22 UTC 2021 - Tom de Vries <tdevries@suse.com>
- DWZ 0.14-rc1 (master branch commit 0d391bf) update:
* Dropped patches:
- dwz-fix-assertion-off-cu_size-in-recompute_abbrevs.patch
- dwz-fix-die-no-multifile-propagation.patch
- dwz-fix-refd-NULL-assertion-in-write_die.patch
- dwz-fix-reference-from-pu-to-cu.patch
- dwz-fix-segfault-in-die_cu.patch
- dwz-testsuite-adjust-pr24468-sh-test-case-for-readelf-with-follow-links.patch
- dwz-testsuite-detect-when-devel-ignore-size-sh-is-unsupported.patch
- dwz-testsuite-fix-partial-unit-grepping-in-pr24468-sh.patch
- dwz-update-version-copyright-message.patch
* Added patches:
- dwz-add-assert-checking-that-cu-is-not-referenced-from-pu.patch
- dwz-call-reorder_dups-asap.patch
- dwz-document-experimental-status-of-odr.patch
- dwz-enable-odr-by-default.patch
- dwz-fix-reference-of-pu-to-cu-for-odr.patch
- dwz-precompute-partitions.patch
- dwz-update-suse-copyright-years.patch
* Added BuildRequires gcc-c++
-------------------------------------------------------------------
Thu Jan 7 10:21:31 UTC 2021 - Tom de Vries <tdevries@suse.com>
- Fix pr24468.sh test-case with newer readelf.
* dwz-testsuite-adjust-pr24468-sh-test-case-for-readelf-with-follow-links.patch
* dwz-testsuite-fix-partial-unit-grepping-in-pr24468-sh.patch
-------------------------------------------------------------------
Thu Jan 7 09:15:48 UTC 2021 - Tom de Vries <tdevries@suse.com>
- Detect when devel-ignore-size.sh is unsupported [swo#27115].
* dwz-testsuite-detect-when-devel-ignore-size-sh-is-unsupported.patch
-------------------------------------------------------------------
Wed Aug 5 08:16:04 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Fix error: source 0 defined multiple times.
-------------------------------------------------------------------
Wed Aug 5 08:00:30 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Silence warning "dwz-rpmlintrc is not mentioned in spec files".
-------------------------------------------------------------------
Wed Aug 5 06:49:52 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Add dwz-rpmlintrc. Add comment to NoSource directive.
-------------------------------------------------------------------
Fri Jan 24 17:08:55 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Fix segfault in die_cu [swo#25456].
* dwz-fix-segfault-in-die_cu.patch
-------------------------------------------------------------------
Fri Jan 17 06:30:58 UTC 2020 - Tom de Vries <tdevries@suse.com>
- Fix reference from compilation unit to partial unit [swo#25398].
* dwz-fix-reference-from-pu-to-cu.patch
-------------------------------------------------------------------
Thu Nov 28 12:56:34 UTC 2019 - Tom de Vries <tdevries@suse.com>
- Fix assertion failure 'refd != NULL' in write_die [swo#24169].
* dwz-fix-refd-NULL-assertion-in-write_die.patch
-------------------------------------------------------------------
Wed Nov 27 18:50:07 UTC 2019 - Tom de Vries <tdevries@suse.com>
- Fix assertion failure 'off == cu_size' in recompute_abbrevs
[swo#24764].
* dwz-fix-assertion-off-cu_size-in-recompute_abbrevs.patch
-------------------------------------------------------------------
Tue Nov 5 09:55:50 UTC 2019 - Tom de Vries <tdevries@suse.com>
- Fix die_no_multifile propagation [swo#25109].
* dwz-fix-die-no-multifile-propagation.patch
-------------------------------------------------------------------
Wed Aug 28 12:47:09 UTC 2019 - Tom de Vries <tdevries@suse.com>
- Disable dwz:testsuite if %{with ringdisabled}
-------------------------------------------------------------------
Fri Aug 16 11:26:06 UTC 2019 - Tom de Vries <tdevries@suse.de>
- Fix copyright years in --version message:
* dwz-update-version-copyright-message.patch
-------------------------------------------------------------------
Tue Aug 13 09:29:02 UTC 2019 - Tom de Vries <tdevries@suse.de>
- Split off dwz-testsuite package using multibuild, to remove build
cycle
- Don't require binutils-gold for riscv64
-------------------------------------------------------------------
Fri Aug 2 10:43:02 UTC 2019 - Tom de Vries <tdevries@suse.de>
- DWZ 0.13 update:
* Dropped patches:
- dwz-0.12-ignore-nobits.patch
- dwz-0.12-DW_OP_GNU_variable_value.patch
- dwz-low-mem-Fix-DW_OP_GNU_parameter_ref-handling-in-read_exprloc.patch
* Added BuildRequires for dejagnu, elfutils, gdb and binutils-gold.
* Add %check
- Add URL tag
-------------------------------------------------------------------
Mon Feb 18 14:31:42 UTC 2019 - tdevries@suse.com
- Add dwz-low-mem-Fix-DW_OP_GNU_parameter_ref-handling-in-read_exprloc.patch
to fix assert on cc1 binary from gcc bootstrap-lto [swo#24195].
-------------------------------------------------------------------
Wed Apr 11 11:02:06 UTC 2018 - rguenther@suse.com
- Add dwz-0.12-DW_OP_GNU_variable_value.patch to handle
DW_OP_GNU_variable_value.
-------------------------------------------------------------------
Wed Mar 14 13:32:56 UTC 2018 - mliska@suse.cz
- Run spec-cleaner on the package.
-------------------------------------------------------------------
Tue Mar 7 09:57:14 UTC 2017 - rguenther@suse.com
- Adjust dwz-0.12-ignore-nobits.patch to also handle non-monotonically
increasing sh_offset as created by the kernel linker script.
-------------------------------------------------------------------
Tue Feb 21 13:35:26 UTC 2017 - rguenther@suse.com
- Add dwz-0.12-ignore-nobits.patch to ignore SHT_NOBITS sections
that are placed out-of-order by objcopy when extracting debuginfo
and place them at sh_offset zero.
-------------------------------------------------------------------
Tue Nov 29 08:51:04 UTC 2016 - rguenther@suse.com
- Update to new upstream version 0.12
* Fix up alignment of non-allocated sections and section header table
after sections which have changed size.
-------------------------------------------------------------------
Wed Dec 10 15:38:40 UTC 2014 - jengelh@inai.de
- Update to new upstream version 0.11
* fix iterative hashing on big-endian targets
* optimize DW_FORM_data[48] DW_AT_high_pc that GCC 4.8 produces
* fix up handling of DIE equality if more than one DIE in the same
CU compare equal
* check DW_FORM_ref_addr properly during fi_multifile phase
* when creating DW_AT_stmt_list, use DW_FORM_sec_offset for dwarf4
and DW_FORM_data4 for dwarf[23] rather than vice versa
* handle .gdb_index version 7 and 8
-------------------------------------------------------------------
Wed Jun 27 14:04:01 CEST 2012 - pth@suse.de
- Initial package

154
dwz.spec Normal file
View File

@ -0,0 +1,154 @@
#
# spec file
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define flavor @BUILD_FLAVOR@%{nil}
%bcond_with ringdisabled
%if "%flavor" == "testsuite"
%if %{with ringdisabled}
ExclusiveArch: do_not_build
%endif
%define build_main 0
%define build_testsuite 1
%else
%define build_main 1
%define build_testsuite 0
%endif
%if %{build_testsuite}
%define debug_package %{nil}
%endif
%if %{build_main}
%define name_suffix %{nil}
%else
%define name_suffix -%{flavor}
%endif
Name: dwz%{name_suffix}
Version: 0.15
Release: 0
%if %{build_main}
Summary: DWARF optimization and duplicate removal tool
License: GPL-2.0-or-later AND LGPL-2.0-or-later
Group: Development/Tools/Building
%endif
%if %{build_testsuite}
Summary: Testsuite results from DWZ
License: GPL-2.0-or-later AND LGPL-2.0-or-later
Group: Development/Tools/Building
%endif
#Git-Clone: git://sourceware.org/git/dwz
#Git-Web: https://sourceware.org/git/?p=dwz.git;a=summary
Source: dwz-%{version}.tar.xz
URL: https://sourceware.org/dwz/
BuildRequires: gcc-c++
BuildRequires: libelf-devel
BuildRequires: xxhash-devel
BuildRequires: xz
%if %{build_testsuite}
BuildRequires: dejagnu
BuildRequires: elfutils
BuildRequires: gdb
%endif
%if !%{build_main}
# It's a bit pointless to ship two identical source packages, one for dwz and
# one for dwz-testsuite. So we make the second one small by excluding the
# source archive. We could do the same for the patches with NoPatch, but the
# gain is smaller there and looks more cumbersome to maintain.
NoSource: 0
%endif
Source1: dwz-rpmlintrc
Source2: tramp3d-v4.cpp.xz
Patch1: dwz-enable-odr-by-default.patch
Patch2: dwz-remove-odr-struct-multifile.sh.patch
%if %{build_main}
%description
dwz optimizes DWARF debugging information contained in ELF shared
libraries and executables for size, by replacing DWARF information
representation with equivalent smaller representation where possible,
and by reducing the amount of duplication using techniques from the
DWARF standard appendix E - creating 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.
The tool handles DWARF 32-bit format debugging sections of versions
2, 3 and 4 and GNU extensions on top of those, though using DWARF 4
or worst case DWARF 3 is strongly recommended.
When not using the -m option (multifile mode), GDB CVS snapshot (soon to be
7.5) is sufficient, when using -m option, GDB from a git branch
http://sources.redhat.com/git/?p=archer.git;a=shortlog;h=refs/heads/archer-tromey-dwz-multifile
is needed.
%endif
%if %{build_testsuite}
%description
This package contains the testsuite results from DWZ.
%endif
%prep
%setup -q -n dwz
%patch1 -p1
%patch2 -p1
cp ../../SOURCES/tramp3d-v4.cpp.xz .
xz -d tramp3d-v4.cpp.xz
%build
%define flags %{optflags} -O3
# Do PGO with tramp3d as input file
%make_build CFLAGS="%{flags} -fprofile-generate" LDFLAGS="-fprofile-generate"
g++ tramp3d-v4.cpp -O2 -g -w -o t1
cp t1 t2
cp t1 t3
cp t1 t4
./dwz -j 1 -m tmp.debug t1 t2 t3 t4
make clean
%make_build CFLAGS="%{flags} -fprofile-use" LDFLAGS="-fprofile-use"
%check
%if %{build_testsuite}
make -k check
%endif
%install
%if %{build_main}
%make_install
%endif
%if %{build_main}
%files
%license COPYING
%{_bindir}/dwz
%{_mandir}/man1/dwz.1%{?ext_man}
%endif
%if %{build_testsuite}
%files
%defattr(-,root,root)
%doc dwz.sum
%doc dwz.log
%endif
%changelog

BIN
tramp3d-v4.cpp.xz (Stored with Git LFS) Normal file

Binary file not shown.