|
Panu Matilainen |
a744c5 |
--- rpm-4.10.0/scripts/find-debuginfo.sh 2012-03-20 09:07:25.000000000 +0100
|
|
Panu Matilainen |
a744c5 |
+++ rpm-4.10.0/scripts/find-debuginfo.sh.jj 2012-06-19 12:32:33.147503858 +0200
|
|
Panu Matilainen |
a744c5 |
@@ -4,6 +4,8 @@
|
|
Panu Matilainen |
a744c5 |
#
|
|
Panu Matilainen |
a744c5 |
# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r]
|
|
Panu Matilainen |
a744c5 |
# [-o debugfiles.list]
|
|
Panu Matilainen |
a744c5 |
+# [--run-dwz] [--dwz-low-mem-die-limit N]
|
|
Panu Matilainen |
a744c5 |
+# [--dwz-max-die-limit N]
|
|
Panu Matilainen |
a744c5 |
# [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
|
|
Panu Matilainen |
a744c5 |
# [builddir]
|
|
Panu Matilainen |
a744c5 |
#
|
|
Panu Matilainen |
a744c5 |
@@ -20,6 +22,10 @@
|
|
Panu Matilainen |
a744c5 |
# The -p argument is an grep -E -style regexp matching the a file name,
|
|
Panu Matilainen |
a744c5 |
# and must not use anchors (^ or $).
|
|
Panu Matilainen |
a744c5 |
#
|
|
Panu Matilainen |
a744c5 |
+# The --run-dwz flag instructs find-debuginfo.sh to run the dwz utility
|
|
Panu Matilainen |
a744c5 |
+# if available, and --dwz-low-mem-die-limit and --dwz-max-die-limit
|
|
Panu Matilainen |
a744c5 |
+# provide detailed limits. See dwz(1) -l and -L option for details.
|
|
Panu Matilainen |
a744c5 |
+#
|
|
Panu Matilainen |
a744c5 |
# All file names in switches are relative to builddir (. if not given).
|
|
Panu Matilainen |
a744c5 |
#
|
|
Panu Matilainen |
a744c5 |
|
|
Panu Matilainen |
a744c5 |
@@ -32,6 +38,11 @@ strip_r=false
|
|
Panu Matilainen |
a744c5 |
# Barf on missing build IDs.
|
|
Panu Matilainen |
a744c5 |
strict=false
|
|
Panu Matilainen |
a744c5 |
|
|
Panu Matilainen |
a744c5 |
+# DWZ parameters.
|
|
Panu Matilainen |
a744c5 |
+run_dwz=false
|
|
Panu Matilainen |
a744c5 |
+dwz_low_mem_die_limit=
|
|
Panu Matilainen |
a744c5 |
+dwz_max_die_limit=
|
|
Panu Matilainen |
a744c5 |
+
|
|
Panu Matilainen |
a744c5 |
BUILDDIR=.
|
|
Panu Matilainen |
a744c5 |
out=debugfiles.list
|
|
Panu Matilainen |
a744c5 |
nout=0
|
|
Panu Matilainen |
a744c5 |
@@ -40,6 +51,17 @@ while [ $# -gt 0 ]; do
|
|
Panu Matilainen |
a744c5 |
--strict-build-id)
|
|
Panu Matilainen |
a744c5 |
strict=true
|
|
Panu Matilainen |
a744c5 |
;;
|
|
Panu Matilainen |
a744c5 |
+ --run-dwz)
|
|
Panu Matilainen |
a744c5 |
+ run_dwz=true
|
|
Panu Matilainen |
a744c5 |
+ ;;
|
|
Panu Matilainen |
a744c5 |
+ --dwz-low-mem-die-limit)
|
|
Panu Matilainen |
a744c5 |
+ dwz_low_mem_die_limit=$2
|
|
Panu Matilainen |
a744c5 |
+ shift
|
|
Panu Matilainen |
a744c5 |
+ ;;
|
|
Panu Matilainen |
a744c5 |
+ --dwz-max-die-limit)
|
|
Panu Matilainen |
a744c5 |
+ dwz_max_die_limit=$2
|
|
Panu Matilainen |
a744c5 |
+ shift
|
|
Panu Matilainen |
a744c5 |
+ ;;
|
|
Panu Matilainen |
a744c5 |
-g)
|
|
Panu Matilainen |
a744c5 |
strip_g=true
|
|
Panu Matilainen |
a744c5 |
;;
|
|
Panu Matilainen |
a744c5 |
@@ -266,6 +288,37 @@ while read nlinks inum f; do
|
|
Panu Matilainen |
a744c5 |
fi
|
|
Panu Matilainen |
a744c5 |
done || exit
|
|
Panu Matilainen |
a744c5 |
|
|
Panu Matilainen |
a744c5 |
+# Invoke the DWARF Compressor utility.
|
|
Panu Matilainen |
a744c5 |
+if $run_dwz && type dwz >/dev/null 2>&1 \
|
|
Panu Matilainen |
a744c5 |
+ && [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
|
|
Panu Matilainen |
a744c5 |
+ dwz_files="`cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug`"
|
|
Panu Matilainen |
a744c5 |
+ if [ -n "${dwz_files}" ]; then
|
|
Panu Matilainen |
a744c5 |
+ dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
|
|
Panu Matilainen |
a744c5 |
+ dwz_multifile_suffix=
|
|
Panu Matilainen |
a744c5 |
+ dwz_multifile_idx=0
|
|
Panu Matilainen |
a744c5 |
+ while [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}${dwz_multifile_suffix}" ]; do
|
|
Panu Matilainen |
a744c5 |
+ let ++dwz_multifile_idx
|
|
Panu Matilainen |
a744c5 |
+ dwz_multifile_suffix=".${dwz_multifile_idx}"
|
|
Panu Matilainen |
a744c5 |
+ done
|
|
Panu Matilainen |
a744c5 |
+ dwz_multfile_name="${dwz_multifile_name}${dwz_multifile_suffix}"
|
|
Panu Matilainen |
a744c5 |
+ dwz_opts="-h -q -r -m .dwz/${dwz_multifile_name}"
|
|
Panu Matilainen |
a744c5 |
+ mkdir -p "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz"
|
|
Panu Matilainen |
a744c5 |
+ [ -n "${dwz_low_mem_die_limit}" ] \
|
|
Panu Matilainen |
a744c5 |
+ && dwz_opts="${dwz_opts} -l ${dwz_low_mem_die_limit}"
|
|
Panu Matilainen |
a744c5 |
+ [ -n "${dwz_max_die_limit}" ] \
|
|
Panu Matilainen |
a744c5 |
+ && dwz_opts="${dwz_opts} -L ${dwz_max_die_limit}"
|
|
Panu Matilainen |
a744c5 |
+ ( cd "${RPM_BUILD_ROOT}/usr/lib/debug" && dwz $dwz_opts $dwz_files )
|
|
Panu Matilainen |
a744c5 |
+ # Remove .dwz directory if empty
|
|
Panu Matilainen |
a744c5 |
+ rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
|
|
Panu Matilainen |
a744c5 |
+ if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then
|
|
Panu Matilainen |
a744c5 |
+ id="`readelf -Wn "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" \
|
|
Panu Matilainen |
a744c5 |
+ 2>/dev/null | sed -n 's/^ Build ID: \([0-9a-f]\+\)/\1/p'`"
|
|
Panu Matilainen |
a744c5 |
+ [ -n "$id" ] \
|
|
Panu Matilainen |
a744c5 |
+ && make_id_link "$id" "/usr/lib/debug/.dwz/${dwz_multifile_name}" .debug
|
|
Panu Matilainen |
a744c5 |
+ fi
|
|
Panu Matilainen |
a744c5 |
+ fi
|
|
Panu Matilainen |
a744c5 |
+fi
|
|
Panu Matilainen |
a744c5 |
+
|
|
Panu Matilainen |
a744c5 |
# For each symlink whose target has a .debug file,
|
|
Panu Matilainen |
a744c5 |
# make a .debug symlink to that file.
|
|
Panu Matilainen |
a744c5 |
find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print |
|
|
Panu Matilainen |
a744c5 |
--- rpm-4.10.0/macros.in 2012-03-20 09:07:25.000000000 +0100
|
|
Panu Matilainen |
a744c5 |
+++ rpm-4.10.0/macros.in.jj 2012-06-19 12:32:33.147503858 +0200
|
|
Panu Matilainen |
a744c5 |
@@ -176,7 +176,7 @@
|
|
Panu Matilainen |
a744c5 |
# the script. See the script for details.
|
|
Panu Matilainen |
a744c5 |
#
|
|
Panu Matilainen |
a744c5 |
%__debug_install_post \
|
|
Panu Matilainen |
a744c5 |
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
|
|
Panu Matilainen |
a744c5 |
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
|
|
Panu Matilainen |
a744c5 |
%{nil}
|
|
Panu Matilainen |
a744c5 |
|
|
Panu Matilainen |
a744c5 |
# Template for debug information sub-package.
|