[packages/debugedit] - new

baggins baggins at pld-linux.org
Wed Nov 10 22:11:20 CET 2021


commit 360a62407851a1fc00b35031cf1e2249d6f797e8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Nov 10 22:10:45 2021 +0100

    - new

 ...e-zero-directory-entry-in-.debug_line-DWA.patch | 130 +++++++++++++++++++++
 debugedit.spec                                     |  67 +++++++++++
 2 files changed, 197 insertions(+)
---
diff --git a/debugedit.spec b/debugedit.spec
new file mode 100644
index 0000000..6869de6
--- /dev/null
+++ b/debugedit.spec
@@ -0,0 +1,67 @@
+#
+# Conditional build:
+%bcond_without	tests		# build without tests
+#
+Summary:	Tools for debuginfo creation
+Name:		debugedit
+Version:	5.0
+Release:	1
+License:	GPL v2/LGPL
+Group:		Applications
+Source0:	https://sourceware.org/ftp/debugedit/%{version}/%{name}-%{version}.tar.xz
+# Source0-md5:	9961a1ae59b6417d27e3a646dc4078b7
+Patch0:		0001-tests-Handle-zero-directory-entry-in-.debug_line-DWA.patch
+URL:		https://sourceware.org/debugedit/
+BuildRequires:	autoconf
+BuildRequires:	automake
+BuildRequires:	elfutils-devel
+BuildRequires:	help2man
+Requires:	awk
+Requires:	binutils
+Requires:	coreutils
+Requires:	dwz
+Requires:	elfutils
+Requires:	findutils
+Requires:	grep
+Requires:	sed
+Requires:	xz
+Suggests:	gdb
+#Provides:	-
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Debugedit provides programs and scripts for creating debuginfo and
+source file distributions, collect build-ids and rewrite source paths
+in DWARF data for debugging, tracing and profiling.
+
+%prep
+%setup -q
+%patch0 -p1
+
+%build
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+%configure
+%{__make}
+
+%{?with_tests:%{__make} check}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_bindir}/debugedit
+%attr(755,root,root) %{_bindir}/find-debuginfo
+%attr(755,root,root) %{_bindir}/sepdebugcrcfix
+%{_mandir}/man1/debugedit.1*
+%{_mandir}/man1/find-debuginfo.1*
+%{_mandir}/man1/sepdebugcrcfix.1*
diff --git a/0001-tests-Handle-zero-directory-entry-in-.debug_line-DWA.patch b/0001-tests-Handle-zero-directory-entry-in-.debug_line-DWA.patch
new file mode 100644
index 0000000..2cadab2
--- /dev/null
+++ b/0001-tests-Handle-zero-directory-entry-in-.debug_line-DWA.patch
@@ -0,0 +1,130 @@
+From ae27211cbbfb63a0ad3c141cd1310d7f583ec40e Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark at klomp.org>
+Date: Fri, 30 Jul 2021 18:09:46 +0200
+Subject: [PATCH] tests: Handle zero directory entry in .debug_line DWARF5
+ debugedit.at
+
+We were skipping the zero directory entry, because it was always
+the same as the directory entry at position one. But that isn't
+true anymore with gcc 11.2.1. There the zero dir entry is unique.
+Fix the debugedit.at .debug_line testcases using DWARF5 to also
+include dir entry zero.
+
+Signed-off-by: Mark Wielaard <mark at klomp.org>
+---
+ configure.ac       | 14 ++++++++++++++
+ tests/atlocal.in   |  1 +
+ tests/debugedit.at | 18 ++++++++++++------
+ 3 files changed, 27 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e5c9230..6a53365 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -87,6 +87,20 @@ CFLAGS="$save_CFLAGS"
+ GDWARF_5_FLAG=$ac_cv_gdwarf_5
+ AC_SUBST([GDWARF_5_FLAG])
+ 
++AC_CACHE_CHECK([whether -gdwarf-5 produced DWARF5 .debug_line], ac_cv_dwarf_5_debugline, [dnl
++save_CFLAGS="$CFLAGS"
++CFLAGS="-gdwarf-5"
++AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i=0;]],[[/* empty main */]])],
++  [if readelf --debug-dump=line conftest.o 2>&1 | \
++   grep "DWARF Version:" 2>&1 | grep "5" > /dev/null 2>&1; \
++     then ac_cv_dwarf_5_debugline=yes; \
++     else ac_cv_dwarf_5_debugline=no; fi],
++  ac_cv_dwarf_5_debugline=no)
++CFLAGS="$save_CFLAGS"
++])
++DWARF_5_DEBUGLINE=$ac_cv_dwarf_5_debugline
++AC_SUBST([DWARF_5_DEBUGLINE])
++
+ AC_CACHE_CHECK([whether gcc supports -gz=none], ac_cv_gz_none, [dnl
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="-gz=none"
+diff --git a/tests/atlocal.in b/tests/atlocal.in
+index 8399f8d..d916301 100644
+--- a/tests/atlocal.in
++++ b/tests/atlocal.in
+@@ -13,3 +13,4 @@ READELF="@READELF@"
+ 
+ GDWARF_5_FLAG=@GDWARF_5_FLAG@
+ GZ_NONE_FLAG=@GZ_NONE_FLAG@
++DWARF_5_DEBUGLINE=@DWARF_5_DEBUGLINE@
+diff --git a/tests/debugedit.at b/tests/debugedit.at
+index 0311d26..725e68e 100644
+--- a/tests/debugedit.at
++++ b/tests/debugedit.at
+@@ -488,10 +488,12 @@ AT_CLEANUP
+ AT_SETUP([debugedit .debug_line objects DWARF5])
+ AT_KEYWORDS([debuginfo] [debugedit])
+ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
++AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
+ DEBUGEDIT_SETUP([-gdwarf-5])
+ 
+ AT_DATA([expout],
+ [foo/bar/baz
++foo/bar/baz/subdir_bar
+ foo/bar/baz/subdir_headers
+ ])
+ 
+@@ -500,8 +502,8 @@ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./subdir_bar/bar.o]])
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./baz.o]])
+ AT_CHECK([[
+ readelf --debug-dump=line foo.o subdir_bar/bar.o baz.o \
+-        | grep -A5 "The Directory Table" | grep "^  [123]" \
+-	| cut -f2- -d/ | grep ^foo/ | sort
++	| grep -A5 "The Directory Table" | grep "^  [0123]" \
++	| cut -f2- -d/ | grep ^foo/ | sort -u
+ ]],[0],[expout])
+ 
+ AT_CLEANUP
+@@ -535,18 +537,20 @@ AT_CLEANUP
+ AT_SETUP([debugedit .debug_line partial DWARF5])
+ AT_KEYWORDS([debuginfo] [debugedit])
+ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
++AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
+ DEBUGEDIT_SETUP([-gdwarf-5])
+ 
+ AT_DATA([expout],
+ [foo/bar/baz
++foo/bar/baz/subdir_bar
+ foo/bar/baz/subdir_headers
+ ])
+ 
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.part.o]])
+ AT_CHECK([[
+ readelf --debug-dump=line ./foobarbaz.part.o \
+-        | grep -A5 "The Directory Table" | grep "^  [123]" \
+-	| cut -f2- -d/ | grep ^foo/ | sort
++	| grep -A5 "The Directory Table" | grep "^  [0123]" \
++	| cut -f2- -d/ | grep ^foo/ | sort -u
+ ]],[0],[expout])
+ 
+ AT_CLEANUP
+@@ -580,18 +584,20 @@ AT_CLEANUP
+ AT_SETUP([debugedit .debug_line exe DWARF5])
+ AT_KEYWORDS([debuginfo] [debugedit])
+ AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"])
++AT_SKIP_IF([test "$DWARF_5_DEBUGLINE" = "no"])
+ DEBUGEDIT_SETUP([-gdwarf-5])
+ 
+ AT_DATA([expout],
+ [foo/bar/baz
++foo/bar/baz/subdir_bar
+ foo/bar/baz/subdir_headers
+ ])
+ 
+ AT_CHECK([[debugedit -b $(pwd) -d /foo/bar/baz ./foobarbaz.exe]])
+ AT_CHECK([[
+ readelf --debug-dump=line ./foobarbaz.exe \
+-        | grep -A5 "The Directory Table" | grep "^  [123]" \
+-	| cut -f2- -d/ | grep ^foo/ | sort
++	| grep -A5 "The Directory Table" | grep "^  [0123]" \
++	| cut -f2- -d/ | grep ^foo/ | sort -u
+ ]],[0],[expout])
+ 
+ AT_CLEANUP
+-- 
+2.27.0
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/debugedit.git/commitdiff/360a62407851a1fc00b35031cf1e2249d6f797e8



More information about the pld-cvs-commit mailing list