3
0
forked from pool/debugedit

Accepting request 919738 from home:gmbr3:rpm4.17

RPM 4.17

OBS-URL: https://build.opensuse.org/request/show/919738
OBS-URL: https://build.opensuse.org/package/show/Base:System/debugedit?expand=0&rev=1
This commit is contained in:
Thomas Renninger 2021-09-28 13:14:06 +00:00 committed by Git OBS Bridge
commit 722c780d45
12 changed files with 303 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

BIN
debugedit-5.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
debugedit-5.0.tar.xz.sig Normal file

Binary file not shown.

11
debugedit.changes Normal file
View File

@ -0,0 +1,11 @@
-------------------------------------------------------------------
Wed Jun 30 13:06:47 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- initial version 5.0
- Added patches from rpm:
* finddebuginfo.patch
* finddebuginfo-absolute-links.patch
* debugsubpkg.patch
* debuglink.patch
* debuginfo-mono.patch
- Add patch to fix bad shift: remove-bad-shift.patch

BIN
debugedit.keyring Normal file

Binary file not shown.

66
debugedit.spec Normal file
View File

@ -0,0 +1,66 @@
#
# spec file for package debugedit
#
# Copyright (c) 2021 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/
#
Name: debugedit
Version: 5.0
Release: 0
Summary: Debuginfo extraction
License: GPL-3.0-or-later
Group: System/Packages
URL: https://www.sourceware.org/debugedit
Source0: https://sourceware.org/ftp/%{name}/%{version}/%{name}-%{version}.tar.xz
Source1: https://sourceware.org/ftp/%{name}/%{version}/%{name}-%{version}.tar.xz.sig
Source2: %{name}.keyring
Patch0: finddebuginfo.patch
Patch1: finddebuginfo-absolute-links.patch
Patch2: debugsubpkg.patch
Patch3: debuglink.patch
Patch4: debuginfo-mono.patch
Patch5: remove-bad-shift.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: help2man
BuildRequires: pkgconfig(libelf)
BuildRequires: pkgconfig(libdw)
%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
%autosetup -p1
%build
autoreconf -fiv
%configure
%make_build
%install
%make_install
%files
%license COPYING3
%doc README
%{_bindir}/debugedit
%{_bindir}/find-debuginfo
%{_bindir}/sepdebugcrcfix
%{_mandir}/man1/debugedit.1%{?ext_man}
%{_mandir}/man1/find-debuginfo.1%{?ext_man}
%{_mandir}/man1/sepdebugcrcfix.1%{?ext_man}
%changelog

19
debuginfo-mono.patch Normal file
View File

@ -0,0 +1,19 @@
--- ./scripts/find-debuginfo.in.orig 2017-12-01 15:40:27.006764372 +0000
+++ ./scripts/find-debuginfo.in 2017-12-01 15:41:17.270619182 +0000
@@ -348,6 +348,16 @@ while read nlinks inum f; do
;;
*) continue ;;
esac
+ # double check that we really have an ELF file,
+ # to handle monodevelop-debugger-gdb and monodevelop-debugger-mdb
+ ftype=`/usr/bin/file $f | cut -d: -f2-`
+ case $ftype in
+ *ELF*) ;;
+ *)
+ echo "$f is not an ELF file, skipping"
+ continue
+ ;;
+ esac
if [ $nlinks -gt 1 ]; then
var=seen_$inum
if test -n "${!var}"; then

11
debuglink.patch Normal file
View File

@ -0,0 +1,11 @@
--- ./scripts/find-debuginfo.in.orig 2017-12-01 15:39:07.239994681 +0000
+++ ./scripts/find-debuginfo.in 2017-12-01 15:39:34.942914702 +0000
@@ -321,7 +321,7 @@ debug_link()
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")
- bn=$(basename "$1" .debug)${unique_debug_suffix}.debug
+ bn=$(basename "$1")${unique_debug_suffix}.debug
debugdn=${debugdir}${dn}
debugfn=${debugdn}/${bn}
}

41
debugsubpkg.patch Normal file
View File

@ -0,0 +1,41 @@
--- ./scripts/find-debuginfo.in.orig 2017-12-01 15:35:59.023537837 +0000
+++ ./scripts/find-debuginfo.in 2017-12-01 15:36:30.351447397 +0000
@@ -548,19 +548,25 @@ if $run_dwz \
fi
fi
-# For each symlink whose target has a .debug file,
-# make a .debug symlink to that file.
-find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
-while read f
-do
- t=$(readlink -m "$f").debug
- f=${f#$RPM_BUILD_ROOT}
- t=${t#$RPM_BUILD_ROOT}
- if [ -f "$debugdir$t" ]; then
- echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
- debug_link "/usr/lib/debug$t" "${f}.debug"
- fi
-done
+# We used to make a .debug symlink for each symlink whose target
+# has a .debug file to that file. This is not necessary because
+# the debuglink section contains only the destination of those links.
+# Creating those links anyway results in debuginfo packages for
+# devel packages just because of the .so symlinks in them.
+
+## For each symlink whose target has a .debug file,
+## make a .debug symlink to that file.
+#find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
+#while read f
+#do
+# t=$(readlink -m "$f").debug
+# f=${f#$RPM_BUILD_ROOT}
+# t=${t#$RPM_BUILD_ROOT}
+# if [ -f "$debugdir$t" ]; then
+# echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
+# debug_link "/usr/lib/debug$t" "${f}.debug"
+# fi
+#done
if [ -s "$SOURCEFILE" ]; then
# See also debugedit invocation. Directories must match up.

View File

@ -0,0 +1,30 @@
From: Jan Blunck <jblunck@suse.de>
Subject: Do the symbolic links right in the first place
Since brp-symlink relinks symbolic links to enforce a certain policy we should
do it right in the first place. So this patch changes find-debuginfo.sh scripts
behavior to reflect that policy.
Signed-off-by: Jan Blunck <jblunck@suse.de>
--- ./scripts/find-debuginfo.in.orig 2017-12-01 15:26:21.939199791 +0000
+++ ./scripts/find-debuginfo.in 2017-12-01 15:27:03.153081225 +0000
@@ -305,7 +305,17 @@ debug_link()
local l="/usr/lib/debug$2"
local t="$1"
echo >> "$LINKSFILE" "$l $t"
- link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+
+ # this should correspond to what brp-symlink is doing
+ case $t in
+ /usr*)
+ link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+ ;;
+ *)
+ mkdir -p "$(dirname "$RPM_BUILD_ROOT$l")" && \
+ ln -snf "$t" "$RPM_BUILD_ROOT$l"
+ ;;
+ esac
}
get_debugfn()

89
finddebuginfo.patch Normal file
View File

@ -0,0 +1,89 @@
--- ./scripts/find-debuginfo.in.orig 2019-09-09 07:56:53.377788842 +0000
+++ ./scripts/find-debuginfo.in 2019-10-02 11:11:56.878979662 +0000
@@ -348,12 +348,18 @@ trap 'rm -rf "$temp"' EXIT
# Build a list of unstripped ELF files and their hardlinks
touch "$temp/primary"
-find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
- \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
- -print | LC_ALL=C sort |
-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped.*/\1/p' |
-xargs --no-run-if-empty stat -c '%h %D_%i %n' |
+find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | LC_ALL=C sort -z |
+xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
+ case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
+ *debuglink*) continue ;;
+ *debug*) ;;
+ *gnu.version*)
+ echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!"
+ continue
+ ;;
+ *) continue ;;
+ esac
if [ $nlinks -gt 1 ]; then
var=seen_$inum
if test -n "${!var}"; then
@@ -386,6 +392,8 @@ do_file()
if [ "$no_recompute_build_id" = "true" ]; then
no_recompute="-n"
fi
+ mode=$(stat -c %a "$f")
+ chmod +w "$f"
id=$(${install_dir}/debugedit -b "$debug_base_name" -d "$debug_dest_name" \
$no_recompute -i \
${build_id_seed:+--build-id-seed="$build_id_seed"} \
@@ -413,17 +421,30 @@ do_file()
# just has its file names collected and adjusted.
case "$dn" in
/usr/lib/debug/*)
+ chmod $mode "$f"
return ;;
esac
mkdir -p "${debugdn}"
- if test -w "$f"; then
- strip_to_debug "${debugfn}" "$f"
- else
- chmod u+w "$f"
- strip_to_debug "${debugfn}" "$f"
- chmod u-w "$f"
- fi
+ objcopy --only-keep-debug "$f" "$debugfn" || :
+ (
+ shopt -s extglob
+ strip_option="--strip-all"
+ case "$f" in
+ *.ko)
+ strip_option="--strip-debug" ;;
+ *$STRIP_KEEP_SYMTAB*)
+ if test -n "$STRIP_KEEP_SYMTAB"; then
+ strip_option="--strip-debug"
+ fi
+ ;;
+ esac
+ if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
+ strip_option=
+ fi
+ objcopy --add-gnu-debuglink="$debugfn" -R .comment -R .GCC.command.line $strip_option "$f"
+ chmod $mode "$f"
+ ) || :
# strip -g implies we have full symtab, don't add mini symtab in that case.
# It only makes sense to add a minisymtab for executables and shared
@@ -581,12 +602,14 @@ if [ -s "$SOURCEFILE" ]; then
# and non-standard modes may be inherented from original directories, fixup
find "${RPM_BUILD_ROOT}${debug_dest_name}" -type d -print0 |
xargs --no-run-if-empty -0 chmod 0755
+ find "${RPM_BUILD_ROOT}${debug_dest_name}" -type f -print0 |
+ xargs --no-run-if-empty -0 chmod a+r
fi
if [ -d "${RPM_BUILD_ROOT}/usr/lib" ] || [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then
((nout > 0)) ||
test ! -d "${RPM_BUILD_ROOT}/usr/lib" ||
- (cd "${RPM_BUILD_ROOT}/usr/lib"; find debug -type d) |
+ (cd "${RPM_BUILD_ROOT}/usr/lib"; test ! -d debug || find debug -type d) |
sed 's,^,%dir /usr/lib/,' >> "$LISTFILE"
(cd "${RPM_BUILD_ROOT}/usr"

10
remove-bad-shift.patch Normal file
View File

@ -0,0 +1,10 @@
--- ./scripts/find-debuginfo.in.orig 2017-12-01 15:40:27.006764372 +0000
+++ ./scripts/find-debuginfo.in 2017-12-01 15:41:17.270619182 +0000
@@ -168,7 +168,6 @@
;;
--dwz-single-file-mode)
dwz_single_file_mode=true
- shift
;;
--build-id-seed)
build_id_seed=$2