# # 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 %{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: 3.1 %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 %autosetup -p1 -n dwz 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 * Mon Feb 26 2024 Dominique Leuenberger - Use %%autosetup macro. Allows to eliminate the usage of deprecated PatchN. * Sun Nov 20 2022 Bernhard Wiedemann - Make PGO training independent from number of build machine cores (boo#1040589) * Mon Nov 7 2022 Martin Liška - 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 2022 Martin Liška - Add dwz-use-grep-E-instead-of-egrep.patch in order to fix build with latest grep package. * Thu Apr 28 2022 Martin Liška - Drop binutils-gold dependency for testsuite as binutils-gold is deprecated and will be removed in the future. * Wed Feb 2 2022 Martin Liška - Silent warnings for tramp3d compilation. * Wed Jan 5 2022 Martin Liška - Add dwz-remove-odr-struct-multifile.sh.patch that removes problematic testcase. * Thu Dec 23 2021 Martin Liška - Start using -O3 and PGO with tramp3d as training binary. * Wed Mar 17 2021 Tom de Vries - 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 2021 Tom de Vries - 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 2021 Tom de Vries - 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 2021 Tom de Vries - Fix testsuite build fail on riscv64: * dwz-testsuite-fix-pr25109.sh-on-riscv64.patch * Fri Feb 26 2021 Tom de Vries - Update reported dwz version * dwz-update-version.patch * Fri Feb 26 2021 Tom de Vries - 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 2021 Tom de Vries - 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 2021 Tom de Vries - Detect when devel-ignore-size.sh is unsupported [swo#27115]. * dwz-testsuite-detect-when-devel-ignore-size-sh-is-unsupported.patch * Wed Aug 5 2020 Tom de Vries - Fix error: source 0 defined multiple times. * Wed Aug 5 2020 Tom de Vries - Silence warning "dwz-rpmlintrc is not mentioned in spec files". * Wed Aug 5 2020 Tom de Vries - Add dwz-rpmlintrc. Add comment to NoSource directive. * Fri Jan 24 2020 Tom de Vries - Fix segfault in die_cu [swo#25456]. * dwz-fix-segfault-in-die_cu.patch * Fri Jan 17 2020 Tom de Vries - Fix reference from compilation unit to partial unit [swo#25398]. * dwz-fix-reference-from-pu-to-cu.patch * Thu Nov 28 2019 Tom de Vries - Fix assertion failure 'refd != NULL' in write_die [swo#24169]. * dwz-fix-refd-NULL-assertion-in-write_die.patch * Wed Nov 27 2019 Tom de Vries - Fix assertion failure 'off == cu_size' in recompute_abbrevs [swo#24764]. * dwz-fix-assertion-off-cu_size-in-recompute_abbrevs.patch * Tue Nov 5 2019 Tom de Vries - Fix die_no_multifile propagation [swo#25109]. * dwz-fix-die-no-multifile-propagation.patch * Wed Aug 28 2019 Tom de Vries - Disable dwz:testsuite if %%{with ringdisabled} * Fri Aug 16 2019 Tom de Vries - Fix copyright years in --version message: * dwz-update-version-copyright-message.patch * Tue Aug 13 2019 Tom de Vries - Split off dwz-testsuite package using multibuild, to remove build cycle - Don't require binutils-gold for riscv64 * Fri Aug 2 2019 Tom de Vries - 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 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 2018 rguenther@suse.com - Add dwz-0.12-DW_OP_GNU_variable_value.patch to handle DW_OP_GNU_variable_value. * Wed Mar 14 2018 mliska@suse.cz - Run spec-cleaner on the package. * Tue Mar 7 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 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 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 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 2012 pth@suse.de - Initial package