2012-07-06 13:26:32 +02:00
|
|
|
#
|
2022-01-13 10:39:43 +01:00
|
|
|
# spec file
|
2012-07-06 13:26:32 +02:00
|
|
|
#
|
2022-01-13 10:39:43 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2012-07-06 13:26:32 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-08-19 12:25:49 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-02-23 13:22:03 +01:00
|
|
|
#
|
|
|
|
|
2019-08-19 12:25:49 +02:00
|
|
|
|
2019-08-13 12:24:27 +02:00
|
|
|
%define flavor @BUILD_FLAVOR@%{nil}
|
2017-02-23 13:22:03 +01:00
|
|
|
|
2019-08-29 02:40:28 +02:00
|
|
|
%bcond_with ringdisabled
|
|
|
|
|
2019-08-13 12:24:27 +02:00
|
|
|
%if "%flavor" == "testsuite"
|
2019-08-29 02:40:28 +02:00
|
|
|
%if %{with ringdisabled}
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%endif
|
2019-08-13 12:24:27 +02:00
|
|
|
%define build_main 0
|
|
|
|
%define build_testsuite 1
|
|
|
|
%else
|
|
|
|
%define build_main 1
|
|
|
|
%define build_testsuite 0
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_testsuite}
|
2021-02-26 15:20:13 +01:00
|
|
|
%define debug_package %{nil}
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_main}
|
|
|
|
%define name_suffix %{nil}
|
|
|
|
%else
|
|
|
|
%define name_suffix -%{flavor}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Name: dwz%{name_suffix}
|
2021-03-18 08:54:52 +01:00
|
|
|
Version: 0.14
|
2017-02-23 13:22:03 +01:00
|
|
|
Release: 0
|
2019-08-13 12:24:27 +02:00
|
|
|
%if %{build_main}
|
2015-01-11 19:54:18 +01:00
|
|
|
Summary: DWARF optimization and duplicate removal tool
|
2019-08-19 12:25:49 +02:00
|
|
|
License: GPL-2.0-or-later AND LGPL-2.0-or-later
|
|
|
|
Group: Development/Tools/Building
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
|
|
|
%if %{build_testsuite}
|
|
|
|
Summary: Testsuite results from DWZ
|
2019-08-19 12:25:49 +02:00
|
|
|
License: GPL-2.0-or-later AND LGPL-2.0-or-later
|
|
|
|
Group: Development/Tools/Building
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
2015-01-11 19:54:18 +01:00
|
|
|
#Git-Clone: git://sourceware.org/git/dwz
|
|
|
|
#Git-Web: https://sourceware.org/git/?p=dwz.git;a=summary
|
2019-08-13 12:24:27 +02:00
|
|
|
Source: dwz-%{version}.tar.xz
|
2020-08-05 20:32:27 +02:00
|
|
|
URL: https://sourceware.org/dwz/
|
2022-01-13 10:39:43 +01:00
|
|
|
BuildRequires: gcc-c++
|
2012-07-06 13:26:32 +02:00
|
|
|
BuildRequires: libelf-devel
|
2015-01-11 19:54:18 +01:00
|
|
|
BuildRequires: xz
|
2019-08-13 12:24:27 +02:00
|
|
|
%if %{build_testsuite}
|
2019-08-05 14:17:32 +02:00
|
|
|
BuildRequires: dejagnu
|
|
|
|
BuildRequires: elfutils
|
|
|
|
BuildRequires: gdb
|
2019-08-13 12:24:27 +02:00
|
|
|
%ifnarch riscv64
|
2019-08-05 14:17:32 +02:00
|
|
|
BuildRequires: binutils-gold
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if !%{build_main}
|
2020-08-05 20:32:27 +02:00
|
|
|
# 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.
|
2019-08-13 12:24:27 +02:00
|
|
|
NoSource: 0
|
|
|
|
%endif
|
2012-07-06 13:26:32 +02:00
|
|
|
|
2020-08-05 20:32:27 +02:00
|
|
|
Source1: dwz-rpmlintrc
|
2022-01-13 10:39:43 +01:00
|
|
|
Source2: tramp3d-v4.cpp.xz
|
2020-08-05 20:32:27 +02:00
|
|
|
|
2021-03-18 08:54:52 +01:00
|
|
|
Patch1: dwz-fix-another-reference-from-pu-to-cu-for-odr.patch
|
|
|
|
Patch2: dwz-handle-reordered-dup-chains-in-create-import-tree.patch
|
|
|
|
Patch3: dwz-enable-odr-by-default.patch
|
|
|
|
Patch4: dwz-testsuite-fix-pr27463.sh-on-riscv64.patch
|
2022-01-13 10:39:43 +01:00
|
|
|
Patch5: dwz-remove-odr-struct-multifile.sh.patch
|
2019-08-19 12:25:49 +02:00
|
|
|
|
2019-08-13 12:24:27 +02:00
|
|
|
%if %{build_main}
|
2012-07-06 13:26:32 +02:00
|
|
|
%description
|
2015-01-11 19:54:18 +01:00
|
|
|
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.
|
2012-07-06 13:26:32 +02:00
|
|
|
|
|
|
|
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.
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_testsuite}
|
|
|
|
%description
|
|
|
|
This package contains the testsuite results from DWZ.
|
|
|
|
%endif
|
2012-07-06 13:26:32 +02:00
|
|
|
|
|
|
|
%prep
|
2019-08-13 12:24:27 +02:00
|
|
|
%setup -q -n dwz
|
2019-08-19 12:25:49 +02:00
|
|
|
%patch1 -p1
|
2019-11-05 13:42:30 +01:00
|
|
|
%patch2 -p1
|
2019-11-27 19:54:59 +01:00
|
|
|
%patch3 -p1
|
2019-11-28 15:10:53 +01:00
|
|
|
%patch4 -p1
|
2022-01-13 10:39:43 +01:00
|
|
|
%patch5 -p1
|
|
|
|
cp ../../SOURCES/tramp3d-v4.cpp.xz .
|
|
|
|
xz -d tramp3d-v4.cpp.xz
|
2012-07-06 13:26:32 +02:00
|
|
|
|
|
|
|
%build
|
2022-01-13 10:39:43 +01:00
|
|
|
%define flags %{optflags} -O3
|
|
|
|
|
|
|
|
# Do PGO with tramp3d as input file
|
|
|
|
%make_build CFLAGS="%{flags} -fprofile-generate" LDFLAGS="-fprofile-generate"
|
2022-02-07 10:49:55 +01:00
|
|
|
g++ tramp3d-v4.cpp -O2 -g -w -o t1
|
2022-01-13 10:39:43 +01:00
|
|
|
cp t1 t2
|
|
|
|
cp t1 t3
|
|
|
|
cp t1 t4
|
|
|
|
./dwz -m tmp.debug t1 t2 t3 t4
|
|
|
|
make clean
|
|
|
|
%make_build CFLAGS="%{flags} -fprofile-use" LDFLAGS="-fprofile-use"
|
2012-07-06 13:26:32 +02:00
|
|
|
|
2019-08-05 14:17:32 +02:00
|
|
|
%check
|
2019-08-13 12:24:27 +02:00
|
|
|
%if %{build_testsuite}
|
2019-08-05 14:17:32 +02:00
|
|
|
make -k check
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
2019-08-05 14:17:32 +02:00
|
|
|
|
2012-07-06 13:26:32 +02:00
|
|
|
%install
|
2019-08-13 12:24:27 +02:00
|
|
|
%if %{build_main}
|
2015-01-11 19:54:18 +01:00
|
|
|
%make_install
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
2012-07-06 13:26:32 +02:00
|
|
|
|
2019-08-13 12:24:27 +02:00
|
|
|
%if %{build_main}
|
2012-07-06 13:26:32 +02:00
|
|
|
%files
|
2018-03-14 14:59:09 +01:00
|
|
|
%license COPYING
|
2012-07-06 13:26:32 +02:00
|
|
|
%{_bindir}/dwz
|
2018-03-14 14:59:09 +01:00
|
|
|
%{_mandir}/man1/dwz.1%{?ext_man}
|
2019-08-13 12:24:27 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_testsuite}
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc dwz.sum
|
|
|
|
%doc dwz.log
|
|
|
|
%endif
|
2012-07-06 13:26:32 +02:00
|
|
|
|
|
|
|
%changelog
|