Compare commits
No commits in common. 'c9' and 'i10cs' have entirely different histories.
@ -1,3 +1,3 @@
|
|||||||
e15e23409266e2a0be8b3748235b126bedbc7b6b SOURCES/debugedit-5.0.tar.xz
|
42dfbb3d9cd25427e0554fdb619e69479816d089 SOURCES/debugedit-5.1.tar.xz
|
||||||
1c91547813dddd09e345df31d8ecfbd0b1aaa9e9 SOURCES/debugedit-5.0.tar.xz.sig
|
346279745035e5e2373ad1e88e3d3a948a4e17dc SOURCES/debugedit-5.1.tar.xz.sig
|
||||||
4c6ca620f5b14e24492616195f7848df0029451c SOURCES/gpgkey-5C1D1AA44BE649DE760A.gpg
|
4c6ca620f5b14e24492616195f7848df0029451c SOURCES/gpgkey-5C1D1AA44BE649DE760A.gpg
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
SOURCES/debugedit-5.0.tar.xz
|
SOURCES/debugedit-5.1.tar.xz
|
||||||
SOURCES/debugedit-5.0.tar.xz.sig
|
SOURCES/debugedit-5.1.tar.xz.sig
|
||||||
SOURCES/gpgkey-5C1D1AA44BE649DE760A.gpg
|
SOURCES/gpgkey-5C1D1AA44BE649DE760A.gpg
|
||||||
|
@ -0,0 +1,100 @@
|
|||||||
|
From 67dee55d160e312b9d0db607630eacfaa3ce08e4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mark Wielaard <mark@klomp.org>
|
||||||
|
Date: Thu, 28 Nov 2024 17:58:54 +0100
|
||||||
|
Subject: [PATCH] find-debuginfo: Check files are writable before modifying
|
||||||
|
them
|
||||||
|
|
||||||
|
Since commit dfe1f7ff3 ("find-debuginfo.sh: Exit with real exit status
|
||||||
|
in parallel jobs") there is a check whether gdb-add-index worked
|
||||||
|
correctly and find-debuginfo would fail (even in parallel mode) if an
|
||||||
|
error occured.
|
||||||
|
|
||||||
|
This turned out to show that gdb-add-index needs write permission to
|
||||||
|
add the gdb index to the file. This is also the case for a couple of
|
||||||
|
other things, like running objcopy --merge-notes. debugedit and
|
||||||
|
add_minidebug already made sure it had write permission.
|
||||||
|
|
||||||
|
To make sure find-debuginfo doesn't (partially) fail extend the
|
||||||
|
writable check to include the gdb-add-index and objcopy --merge-notes
|
||||||
|
invocation.
|
||||||
|
---
|
||||||
|
scripts/find-debuginfo.in | 33 +++++++++++++++++++++++++++++++--
|
||||||
|
1 file changed, 31 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in
|
||||||
|
index a360bf0582dc..4e4ef5a64005 100755
|
||||||
|
--- a/scripts/find-debuginfo.in
|
||||||
|
+++ b/scripts/find-debuginfo.in
|
||||||
|
@@ -481,14 +481,29 @@ do_file()
|
||||||
|
$strict && return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
+ # debugedit makes sure to to get write permission to the file and
|
||||||
|
+ # restores original state after modifications. Other utilities
|
||||||
|
+ # might not.
|
||||||
|
+ f_writable="false"
|
||||||
|
+ if test -w "$f"; then f_writable="true"; fi
|
||||||
|
+
|
||||||
|
# Add .gdb_index if requested.
|
||||||
|
if $include_gdb_index; then
|
||||||
|
if type gdb-add-index >/dev/null 2>&1; then
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u+w "$f"
|
||||||
|
+ fi
|
||||||
|
gdb-add-index "$f" || {
|
||||||
|
status=$?
|
||||||
|
echo >&2 "*** ERROR:: GDB exited with exit status $status during index generation"
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u-w "$f"
|
||||||
|
+ fi
|
||||||
|
return 2
|
||||||
|
}
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u-w "$f"
|
||||||
|
+ fi
|
||||||
|
else
|
||||||
|
echo >&2 "*** ERROR: GDB index requested, but no gdb-add-index installed"
|
||||||
|
return 2
|
||||||
|
@@ -497,7 +512,13 @@ do_file()
|
||||||
|
|
||||||
|
# Compress any annobin notes in the original binary.
|
||||||
|
# Ignore any errors, since older objcopy don't support --merge-notes.
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u+w "$f"
|
||||||
|
+ fi
|
||||||
|
objcopy --merge-notes "$f" 2>/dev/null || true
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u-w "$f"
|
||||||
|
+ fi
|
||||||
|
|
||||||
|
# A binary already copied into /usr/lib/debug doesn't get stripped,
|
||||||
|
# just has its file names collected and adjusted.
|
||||||
|
@@ -507,7 +528,7 @@ do_file()
|
||||||
|
esac
|
||||||
|
|
||||||
|
mkdir -p "${debugdn}"
|
||||||
|
- if test -w "$f"; then
|
||||||
|
+ if test "$f_writable" = "true"; then
|
||||||
|
strip_to_debug "${debugfn}" "$f"
|
||||||
|
else
|
||||||
|
chmod u+w "$f"
|
||||||
|
@@ -529,7 +550,15 @@ do_file()
|
||||||
|
application/x-executable*) skip_mini=false ;;
|
||||||
|
application/x-pie-executable*) skip_mini=false ;;
|
||||||
|
esac
|
||||||
|
- $skip_mini || add_minidebug "${debugfn}" "$f"
|
||||||
|
+ if test "$skip_mini" = "true"; then
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u+w "$f"
|
||||||
|
+ fi
|
||||||
|
+ add_minidebug "${debugfn}" "$f"
|
||||||
|
+ if test "$f_writable" = "false"; then
|
||||||
|
+ chmod u-w "$f"
|
||||||
|
+ fi
|
||||||
|
+ fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "./${f#$RPM_BUILD_ROOT}" >> "$ELFBINSFILE"
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
@ -1,130 +0,0 @@
|
|||||||
From ae27211cbbfb63a0ad3c141cd1310d7f583ec40e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mark Wielaard <mark@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@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
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
|||||||
From b8ac71d9f88202f00a32c5a8b3b4b93bb2fa110a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Prarit Bhargava <prarit@redhat.com>
|
|
||||||
Date: Thu, 26 Jan 2023 16:08:57 -0500
|
|
||||||
Subject: [PATCH] scripts/find-debuginfo.in: Add -q|--quiet
|
|
||||||
|
|
||||||
Projects with a large number of compiled files end up with a large number
|
|
||||||
of 'extracting debug info from' messages in the build log. In the case of
|
|
||||||
the Fedora kernel these messages account for 8504 lines in the log, or 61%
|
|
||||||
of the entire log [1].
|
|
||||||
|
|
||||||
Removing these lines make the log easier to view and comprehend for some
|
|
||||||
projects, however, not all projects will want to silence these messages so
|
|
||||||
suppressing them must be optional.
|
|
||||||
|
|
||||||
Add a -q|--quiet which allows users to silence the non-error output from
|
|
||||||
the script.
|
|
||||||
|
|
||||||
[1] https://kojipkgs.fedoraproject.org//packages/kernel/6.2.0/0.rc5.20230123git2475bf0250de.38.fc38/data/logs/x86_64/build.log
|
|
||||||
|
|
||||||
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
|
|
||||||
---
|
|
||||||
scripts/find-debuginfo.in | 22 +++++++++++++++-------
|
|
||||||
1 file changed, 15 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in
|
|
||||||
index 8090c84..7dec3c3 100755
|
|
||||||
--- a/scripts/find-debuginfo.in
|
|
||||||
+++ b/scripts/find-debuginfo.in
|
|
||||||
@@ -26,7 +26,7 @@ Usage: find-debuginfo [OPTION]... [builddir]
|
|
||||||
automagically generates debug info and file lists
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-[--strict-build-id] [-g] [-r] [-m] [-i] [-n]
|
|
||||||
+[--strict-build-id] [-g] [-r] [-m] [-i] [-n] [-q]
|
|
||||||
[--keep-section SECTION] [--remove-section SECTION]
|
|
||||||
[--g-libs]
|
|
||||||
[-j N] [--jobs N]
|
|
||||||
@@ -94,6 +94,8 @@ will be called /usr/debug/src/<BASE>. This makes sure the debug source
|
|
||||||
dirs are unique between package version, release and achitecture (Use
|
|
||||||
--unique-debug-src-base "%{name}-%{VERSION}-%{RELEASE}.%{_arch}")
|
|
||||||
|
|
||||||
+The -q or --quiet flag silences non-error output from the script.
|
|
||||||
+
|
|
||||||
All file names in switches are relative to builddir ('.' if not given).
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
@@ -146,6 +148,9 @@ n_jobs=1
|
|
||||||
# exit early on --version or --help
|
|
||||||
done=false
|
|
||||||
|
|
||||||
+# silence non-error output
|
|
||||||
+quiet=false
|
|
||||||
+
|
|
||||||
BUILDDIR=.
|
|
||||||
out=debugfiles.list
|
|
||||||
srcout=
|
|
||||||
@@ -239,6 +244,9 @@ while [ $# -gt 0 ]; do
|
|
||||||
srcout=$2
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
+ -q|--quiet)
|
|
||||||
+ quiet=true
|
|
||||||
+ ;;
|
|
||||||
--version)
|
|
||||||
echo "find-debuginfo @VERSION@"
|
|
||||||
done=true;
|
|
||||||
@@ -437,7 +445,7 @@ do_file()
|
|
||||||
get_debugfn "$f"
|
|
||||||
[ -f "${debugfn}" ] && return
|
|
||||||
|
|
||||||
- echo "extracting debug info from $f"
|
|
||||||
+ $quiet || echo "extracting debug info from $f"
|
|
||||||
# See also cpio SOURCEFILE copy. Directories must match up.
|
|
||||||
debug_base_name="$RPM_BUILD_DIR"
|
|
||||||
debug_dest_name="/usr/src/debug"
|
|
||||||
@@ -513,7 +521,7 @@ do_file()
|
|
||||||
grep "^$inum " "$temp/linked" | while read inum linked; do
|
|
||||||
link=$debugfn
|
|
||||||
get_debugfn "$linked"
|
|
||||||
- echo "hard linked $link to $debugfn"
|
|
||||||
+ $quiet || echo "hard linked $link to $debugfn"
|
|
||||||
mkdir -p "$(dirname "$debugfn")" && ln -nf "$link" "$debugfn"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
@@ -576,7 +584,7 @@ if $run_dwz \
|
|
||||||
&& [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
|
|
||||||
readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug | LC_ALL=C sort)
|
|
||||||
if [ ${#dwz_files[@]} -gt 0 ]; then
|
|
||||||
- size_before=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
|
|
||||||
+ $quiet || size_before=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
|
|
||||||
dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
|
|
||||||
dwz_multifile_suffix=
|
|
||||||
dwz_multifile_idx=0
|
|
||||||
@@ -600,8 +608,8 @@ if $run_dwz \
|
|
||||||
echo >&2 "*** ERROR: DWARF compression requested, but no dwz installed"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
- size_after=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
|
|
||||||
- echo "original debug info size: ${size_before}kB, size after compression: ${size_after}kB"
|
|
||||||
+ $quiet || size_after=$(du -sk ${RPM_BUILD_ROOT}/usr/lib/debug | cut -f1)
|
|
||||||
+ $quiet || echo "original debug info size: ${size_before}kB, size after compression: ${size_after}kB"
|
|
||||||
# Remove .dwz directory if empty
|
|
||||||
rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
|
|
||||||
|
|
||||||
@@ -621,7 +629,7 @@ do
|
|
||||||
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"
|
|
||||||
+ $quiet || echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
|
|
||||||
debug_link "/usr/lib/debug$t" "${f}.debug"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
--
|
|
||||||
2.39.1
|
|
||||||
|
|
Loading…
Reference in new issue