From a2c5ba019399a695643a73d1fbf5d8793d01e66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Wed, 14 Oct 2020 23:54:20 +0200 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/dwz#a1324d7885666feffae8ce625c0899557692a742 --- .gitignore | 11 +++ dwz.spec | 138 +++++++++++++++++++++++++++++++ sources | 1 + tests/dwz-quick-test/Makefile | 63 ++++++++++++++ tests/dwz-quick-test/PURPOSE | 3 + tests/dwz-quick-test/cmd.txt | 7 ++ tests/dwz-quick-test/runtest.sh | 60 ++++++++++++++ tests/dwz-quick-test/something.c | 21 +++++ tests/inventory | 4 + tests/tests.yml | 20 +++++ 10 files changed, 328 insertions(+) create mode 100644 dwz.spec create mode 100644 sources create mode 100644 tests/dwz-quick-test/Makefile create mode 100644 tests/dwz-quick-test/PURPOSE create mode 100644 tests/dwz-quick-test/cmd.txt create mode 100755 tests/dwz-quick-test/runtest.sh create mode 100644 tests/dwz-quick-test/something.c create mode 100755 tests/inventory create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..bc3e7ea 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,11 @@ +/dwz-0.3.tar.bz2 +/dwz-0.4.tar.bz2 +/dwz-0.5.tar.bz2 +/dwz-0.6.tar.bz2 +/dwz-0.7.tar.bz2 +/dwz-0.8.tar.bz2 +/dwz-0.9.tar.bz2 +/dwz-0.10.tar.bz2 +/dwz-0.11.tar.bz2 +/dwz-0.12.tar.bz2 +/dwz-0.13.tar.xz diff --git a/dwz.spec b/dwz.spec new file mode 100644 index 0000000..db64a46 --- /dev/null +++ b/dwz.spec @@ -0,0 +1,138 @@ +Summary: DWARF optimization and duplicate removal tool +Name: dwz +Version: 0.13 +Release: 4%{?dist} +License: GPLv2+ and GPLv3+ +Source: https://sourceware.org/ftp/dwz/releases/%{name}-%{version}.tar.xz +BuildRequires: gcc, elfutils-libelf-devel, dejagnu + +%description +The dwz package contains a program that attempts to optimize DWARF +debugging information contained in ELF shared libraries and ELF executables +for size, by replacing DWARF information representation with equivalent +smaller representation where possible and by reducing the amount of +duplication using techniques from 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. + +%prep +%setup -q -n dwz + +%build +%make_build CFLAGS='%{optflags}' LDFLAGS='%{build_ldflags}' \ + prefix=%{_prefix} mandir=%{_mandir} bindir=%{_bindir} + +%install +rm -rf %{buildroot} +%make_install prefix=%{_prefix} mandir=%{_mandir} bindir=%{_bindir} + +%check +make check + +%files +%license COPYING COPYING3 COPYING.RUNTIME +%{_bindir}/dwz +%{_mandir}/man1/dwz.1* + +%changelog +* Mon Jul 27 2020 Fedora Release Engineering - 0.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 13 2020 Tom Stellard - 0.13-3 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Tue Jan 28 2020 Fedora Release Engineering - 0.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Dec 11 2019 Jakub Jelinek 0.13-1 +- update to a new upstream release +- add make check + +* Wed Jul 24 2019 Fedora Release Engineering - 0.12-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 0.12-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 19 2018 Marek Polacek 0.12-9 +- remove %{?_isa} from BuildRequires (#1545173) +- add gcc to BuildRequires + +* Thu Jul 12 2018 Fedora Release Engineering - 0.12-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 23 2018 Florian Weimer - 0.12-7 +- Use LDFLAGS from redhat-rpm-config + +* Wed Feb 07 2018 Fedora Release Engineering - 0.12-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 0.12-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.12-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Feb 01 2017 Stephen Gallagher - 0.12-3 +- Add missing %%license macro + +* Wed Feb 03 2016 Fedora Release Engineering - 0.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Jul 13 2015 Jakub Jelinek 0.12-1 +- fix up alignment of moved non-allocated sections and section header table + +* Wed Jun 17 2015 Fedora Release Engineering - 0.11-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Feb 21 2015 Till Maas - 0.11-5 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sat Aug 16 2014 Fedora Release Engineering - 0.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 0.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 0.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue Jul 2 2013 Jakub Jelinek 0.11-1 +- handle .gdb_index version 8 (#969454) + +* Mon Mar 11 2013 Jakub Jelinek 0.10-1 +- when creating DW_AT_stmt_list, use DW_FORM_sec_offset for dwarf4 + and DW_FORM_data4 for dwarf[23] rather than vice versa (#919755) + +* Mon Feb 4 2013 Jakub Jelinek 0.9-1 +- fix up handling of DIE equality if more than one DIE in the same + CU compare equal (#889283) +- check DW_FORM_ref_addr properly during fi_multifile phase + +* Thu Nov 29 2012 Jakub Jelinek 0.8-1 +- fix recompute_abbrevs (#880634) +- optimize DW_FORM_data[48] DW_AT_high_pc that GCC 4.8 produces + +* Fri Aug 10 2012 Jakub Jelinek 0.7-1 +- fix iterative hasing on big-endian targets (#846685) + +* Wed Jul 18 2012 Fedora Release Engineering - 0.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 17 2012 Jakub Jelinek 0.6-1 +- add --version/-v option support (Matt Newsome) +- fix building on RHEL 5 + +* Wed Jul 4 2012 Jakub Jelinek 0.5-1 +- handle .gdb_index version 7 + +* Fri Jun 22 2012 Jakub Jelinek 0.4-1 +- fix up DIE counting in low-mem mode for testing the -L limit + +* Fri Jun 15 2012 Jakub Jelinek 0.3-1 +- update to dwz-0.3 (#830863) + +* Mon Jun 11 2012 Jakub Jelinek 0.2-1 +- new package diff --git a/sources b/sources new file mode 100644 index 0000000..b5fb5b5 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (dwz-0.13.tar.xz) = 8dc5e647a99ab652fbbed2d37c595a072a2e31198e66f84220d4caf04a9ee0b2900b116932f268b68015e4cc6b49b87313bf1a2d00748d2b3c4799c9ee58c2f4 diff --git a/tests/dwz-quick-test/Makefile b/tests/dwz-quick-test/Makefile new file mode 100644 index 0000000..be2e9cf --- /dev/null +++ b/tests/dwz-quick-test/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/dwz/dwz-quick-test +# Description: Quick sanity test +# Author: Miroslav Franc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/dwz/dwz-quick-test +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE something.c cmd.txt + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Miroslav Franc " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Quick sanity test" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 2m" >> $(METADATA) + @echo "RunFor: dwz" >> $(METADATA) + @echo "Requires: dwz gcc gdb glibc-debuginfo" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/dwz-quick-test/PURPOSE b/tests/dwz-quick-test/PURPOSE new file mode 100644 index 0000000..c5b39d4 --- /dev/null +++ b/tests/dwz-quick-test/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/dwz/dwz-quick-test +Description: Quick sanity test +Author: Miroslav Franc diff --git a/tests/dwz-quick-test/cmd.txt b/tests/dwz-quick-test/cmd.txt new file mode 100644 index 0000000..c807bca --- /dev/null +++ b/tests/dwz-quick-test/cmd.txt @@ -0,0 +1,7 @@ +b f +r +s +p x +p/x var +c +q diff --git a/tests/dwz-quick-test/runtest.sh b/tests/dwz-quick-test/runtest.sh new file mode 100755 index 0000000..87b0e28 --- /dev/null +++ b/tests/dwz-quick-test/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/dwz/dwz-quick-test +# Description: Quick sanity test +# Author: Miroslav Franc +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm gcc + rlAssertRpm gdb + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp something.c cmd.txt $TmpDir" + rlRun "pushd $TmpDir" + rlRun "gcc -g -O2 something.c -o something.out" + rlRun "cp something.out something.dwz" + rlPhaseEnd + + rlPhaseStartTest "no crash + saved space" + rlRun "dwz something.dwz" + rlRun "[[ $(wc -c log 2>&1" + rlRun "[[ $(grep -c 'hello, world' log) -eq 2 ]]" + rlAssertGrep '$1 = -1' log + rlAssertGrep '$2 = 0x2a' log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/dwz-quick-test/something.c b/tests/dwz-quick-test/something.c new file mode 100644 index 0000000..4dd3b6e --- /dev/null +++ b/tests/dwz-quick-test/something.c @@ -0,0 +1,21 @@ +#include + +void f (int x); + +int +main (int argc, char *argv[]) +{ + int a = -1; + + f(a); + + return 0; +} + +void +f (int x) +{ + static int var __attribute__ ((used)) = 42; + if(x) + puts("hello, world"); +} diff --git a/tests/inventory b/tests/inventory new file mode 100755 index 0000000..3ca7992 --- /dev/null +++ b/tests/inventory @@ -0,0 +1,4 @@ +#!/bin/bash +export TEST_DOCKER_EXTRA_ARGS="--cap-add=SYS_PTRACE" +exec merge-standard-inventory "$@" + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..f2acd21 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,20 @@ +- hosts: localhost + tags: + - classic + - container # needs SYS_PTRACE + pre_tasks: + - name: Install deguginfo-install + shell: dnf -y install "dnf-command(debuginfo-install)" + - name: Install debuginfo for packages + shell: dnf -y debuginfo-install --best {{item}} + with_items: + - glibc + roles: + - role: standard-test-beakerlib + tests: + - dwz-quick-test + required_packages: + - dwz + - gcc + - gdb + - glibc-debuginfo