debugedit/0001-find-debuginfo-Make-return-from-do_file-explicit.patch
Mark Wielaard 9845c38f83 xxhash-static, .gnu_debugdata and hard-link fixes
- BuildRequires xxhash-static
debugedit builds with XXH_INLINE_ALL, so depend on (virtual) xxhash-static
This makes it easier to find all packages that depend on xxhash when
they might need to be rebuild because of an xxhash upgrade.

find-debuginfo: Fix skip_mini (".gnu_debugdata") handling
- Add 0001-find-debuginfo-Fix-skip_mini-.gnu_debugdata-handling.patch
Resolves: RHEL-74257
debugedit doesn't add .gnu_debugdata anymore

- Add 0001-find-debuginfo-Make-return-from-do_file-explicit.patch
Resolves: RHEL-75261
executables with multiple hard-links (outside buildroot) make
find-debugedit fail
2025-01-20 15:32:12 +01:00

69 lines
2.1 KiB
Diff

From 1869e3b886c4596fb4ce471dd08121401d207cfa Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 16 Jan 2025 19:09:00 +0100
Subject: [PATCH] find-debuginfo: Make return from do_file explicit
Make all returns from do_file explicit so they don't implicitly return
the result of the last command. Also make sure the $temp/linked file
exists, even if it is empty. A file could have hardlinks to files not
under the buildroot.
https://bugzilla.redhat.com/show_bug.cgi?id=2334760
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
scripts/find-debuginfo.in | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in
index a360bf0582dc..d102e8937775 100755
--- a/scripts/find-debuginfo.in
+++ b/scripts/find-debuginfo.in
@@ -434,6 +434,7 @@ trap 'rm -rf "$temp"' EXIT
# Build a list of unstripped ELF files and their hardlinks
touch "$temp/primary"
+touch "$temp/linked"
find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
\( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
-print | LC_ALL=C sort |
@@ -458,7 +459,7 @@ do_file()
local nlinks=$1 inum=$2 f=$3 id link linked
get_debugfn "$f"
- [ -f "${debugfn}" ] && return
+ [ -f "${debugfn}" ] && return 0
$verbose && echo "extracting debug info from $f"
# See also cpio SOURCEFILE copy. Directories must match up.
@@ -475,7 +476,7 @@ do_file()
id=$(debugedit -b "$debug_base_name" -d "$debug_dest_name" \
$no_recompute -i \
${build_id_seed:+--build-id-seed="$build_id_seed"} \
- -l "$SOURCEFILE" "$f") || exit
+ -l "$SOURCEFILE" "$f") || return 1
if [ -z "$id" ]; then
echo >&2 "*** ${strict_error}: No build ID note found in $f"
$strict && return 2
@@ -503,7 +504,7 @@ do_file()
# just has its file names collected and adjusted.
case "$dn" in
/usr/lib/debug/*)
- return ;;
+ return 0 ;;
esac
mkdir -p "${debugdn}"
@@ -544,6 +545,8 @@ do_file()
mkdir -p "$(dirname "$debugfn")" && ln -nf "$link" "$debugfn"
done
fi
+
+ return 0
}
# 16^6 - 1 or about 16 million files
--
2.47.1