Mark Wielaard's backports for debuginfo parallel installation etc (#1427970)

This commit is contained in:
Panu Matilainen 2017-03-08 11:25:36 +02:00
parent e3416e53e4
commit 5b4d9835cd
13 changed files with 5653 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,351 @@
From 2a97fb48279af17049f96c661db040173185a650 Mon Sep 17 00:00:00 2001
Message-Id: <2a97fb48279af17049f96c661db040173185a650.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Mark Wielaard <mjw@redhat.com>
Date: Tue, 14 Jun 2016 17:07:13 +0200
Subject: [PATCH 02/11] Make it possible to have unique build-ids across build
versions/releases.
Introduce a new macro _unique_build_ids that when set will pass the
version and release to find-debuginfo.sh and debugedit to recalculate
the build-id of ELF files.
Includes two new testcases to make sure the new setting works as expected
both when set and unset.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
macros.in | 8 +++-
scripts/find-debuginfo.sh | 20 ++++++++-
tests/data/SPECS/hello-r2.spec | 58 +++++++++++++++++++++++++
tests/rpmbuildid.at | 96 +++++++++++++++++++++++++++++++++++++++++-
tools/debugedit.c | 24 ++++++++++-
5 files changed, 201 insertions(+), 5 deletions(-)
create mode 100644 tests/data/SPECS/hello-r2.spec
diff --git a/macros.in b/macros.in
index e43d62b0..dcd0961 100644
--- a/macros.in
+++ b/macros.in
@@ -180,7 +180,7 @@
# the script. See the script for details.
#
%__debug_install_post \
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_unique_build_ids:--ver-rel "%{version}-%{release}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
%{nil}
# Template for debug information sub-package.
@@ -476,6 +476,12 @@ package or when debugging this package.\
# ELF /usr/lib/debug/.build-id/xx/yyy -> /usr/lib/.build-id/xx/yyy
%_build_id_links compat
+# Whether build-ids should be made unique between package version/releases
+# when generating debuginfo packages. If set to 1 this will pass
+# --ver-rel "%{version}-%{release}" to find-debuginfo.sh which will pass it
+# onto debugedit --build-id-seed to be used to prime the build-id note hash.
+%_unique_build_ids 1
+
#
# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator 1
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index c9e2293..2cb9570 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -6,6 +6,7 @@
# [-o debugfiles.list]
# [--run-dwz] [--dwz-low-mem-die-limit N]
# [--dwz-max-die-limit N]
+# [--ver-rel VERSION-RELEASE]
# [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
# [builddir]
#
@@ -26,6 +27,12 @@
# if available, and --dwz-low-mem-die-limit and --dwz-max-die-limit
# provide detailed limits. See dwz(1) -l and -L option for details.
#
+# If --ver-rel VERSION-RELEASE is given then debugedit is called to
+# update the build-ids it finds adding the VERSION-RELEASE string as
+# seed to recalculate the build-id hash. This makes sure the
+# build-ids in the ELF files are unique between versions and releases
+# of the same package.
+#
# All file names in switches are relative to builddir (. if not given).
#
@@ -49,6 +56,9 @@ run_dwz=false
dwz_low_mem_die_limit=
dwz_max_die_limit=
+# Version and release of the spec. Given by --ver-rel
+ver_rel=
+
BUILDDIR=.
out=debugfiles.list
nout=0
@@ -68,6 +78,10 @@ while [ $# -gt 0 ]; do
dwz_max_die_limit=$2
shift
;;
+ --ver-rel)
+ ver_rel=$2
+ shift
+ ;;
-g)
strip_g=true
;;
@@ -249,8 +263,12 @@ while read nlinks inum f; do
fi
echo "extracting debug info from $f"
+ build_id_seed=
+ if [ ! -z "$ver_rel" ]; then
+ build_id_seed="--build-id-seed=$ver_rel"
+ fi
id=$(${lib_rpm_dir}/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
- -i -l "$SOURCEFILE" "$f") || exit
+ -i $build_id_seed -l "$SOURCEFILE" "$f") || exit
if [ $nlinks -gt 1 ]; then
eval linkedid_$inum=\$id
fi
diff --git a/tests/data/SPECS/hello-r2.spec b/tests/data/SPECS/hello-r2.spec
new file mode 100644
index 0000000..ca5091d
--- /dev/null
+++ b/tests/data/SPECS/hello-r2.spec
@@ -0,0 +1,58 @@
+Summary: hello -- hello, world rpm
+Name: hello
+Version: 1.0
+Release: 2
+Group: Utilities
+License: GPL
+Distribution: RPM test suite.
+Vendor: Red Hat Software
+Packager: Red Hat Software <bugs@redhat.com>
+URL: http://www.redhat.com
+Source0: hello-1.0.tar.gz
+Patch0: hello-1.0-modernize.patch
+Excludearch: lsi
+Excludeos: cpm
+Provides: hi
+Conflicts: goodbye
+Obsoletes: howdy
+Prefix: /usr
+
+%description
+Simple rpm demonstration.
+
+%prep
+%setup -q
+%patch0 -p1 -b .modernize
+
+%build
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/local/bin
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+
+%post
+
+%preun
+
+%postun
+
+%files
+%defattr(-,root,root)
+%doc FAQ
+#%readme README
+#%license COPYING
+%attr(0751,root,root) /usr/local/bin/hello
+
+%changelog
+* Wed Jun 8 2016 Mark Wielaard <mjw@redhat.com>
+- Update release for unique build-id generation tests.
+
+* Tue Oct 20 1998 Jeff Johnson <jbj@redhat.com>
+- create.
diff --git a/tests/rpmbuildid.at b/tests/rpmbuildid.at
index eddca96..1da6302 100644
--- a/tests/rpmbuildid.at
+++ b/tests/rpmbuildid.at
@@ -758,4 +758,98 @@ debug id in debug package
debug dup id in debug package
],
[])
-AT_CLEANUP
\ No newline at end of file
+AT_CLEANUP
+
+# ------------------------------
+# Check build-ids are unique between versions/releases
+# with _unique_build_ids defined.
+AT_SETUP([rpmbuild buildid unique r1 r2])
+AT_KEYWORDS([build] [debuginfo] [buildid])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# No warnings for hard links
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define="_unique_build_ids 1" \
+ -ba "${abs_srcdir}"/data/SPECS/hello.spec
+
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
+ | cpio -diu --quiet
+
+hello_file=./usr/local/bin/hello
+
+# Extract the build-id from the main file
+id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+# Build the "next" release, which has no changes except for the release update.
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define="_unique_build_ids 1" \
+ -ba "${abs_srcdir}"/data/SPECS/hello-r2.spec
+
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
+ | cpio -diu --quiet
+
+# Extract the build-id from the main file
+id2=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+if test "$id1" == "$id2"; then echo "equal $id1"; else echo "unequal"; fi
+],
+[0],
+[unequal
+],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check build-ids are non-unique between versions/releases
+# with _unique_build_ids undefined (and exact same sources).
+AT_SETUP([rpmbuild buildid non-unique r1 r2])
+AT_KEYWORDS([build] [debuginfo] [buildid])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# No warnings for hard links
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --undefine="_unique_build_ids" \
+ -ba "${abs_srcdir}"/data/SPECS/hello.spec
+
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
+ | cpio -diu --quiet
+
+hello_file=./usr/local/bin/hello
+
+# Extract the build-id from the main file
+id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+# Build the "next" release, which has no changes except for the release update.
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --undefine="_unique_build_ids" \
+ -ba "${abs_srcdir}"/data/SPECS/hello-r2.spec
+
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
+ | cpio -diu --quiet
+
+# Extract the build-id from the main file
+id2=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+if test "$id1" == "$id2"; then echo "equal"; else echo "unequal $id1 $id2"; fi
+],
+[0],
+[equal
+],
+[ignore])
+AT_CLEANUP
diff --git a/tools/debugedit.c b/tools/debugedit.c
index cf89312..c0147f0 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010, 2011 Red Hat, Inc.
+/* Copyright (C) 2001-2003, 2005, 2007, 2009-2011, 2016 Red Hat, Inc.
Written by Alexander Larsson <alexl@redhat.com>, 2002
Based on code by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -54,6 +54,7 @@ char *dest_dir = NULL;
char *list_file = NULL;
int list_file_fd = -1;
int do_build_id = 0;
+char *build_id_seed = NULL;
typedef struct
{
@@ -1296,6 +1297,8 @@ static struct poptOption optionsTable[] = {
"file where to put list of source and header file names", NULL },
{ "build-id", 'i', POPT_ARG_NONE, &do_build_id, 0,
"recompute build ID note and print ID on stdout", NULL },
+ { "build-id-seed", 's', POPT_ARG_STRING, &build_id_seed, 0,
+ "if recomputing the build ID note use this string as hash seed", NULL },
POPT_AUTOHELP
{ NULL, 0, 0, NULL, 0, NULL, NULL }
};
@@ -1400,7 +1403,7 @@ handle_build_id (DSO *dso, Elf_Data *build_id,
exit (1);
}
- if (!dirty_elf)
+ if (!dirty_elf && build_id_seed == NULL)
goto print;
if (elf_update (dso->elf, ELF_C_NULL) < 0)
@@ -1415,6 +1418,10 @@ handle_build_id (DSO *dso, Elf_Data *build_id,
ctx = rpmDigestInit(algorithm, 0);
+ /* If a seed string was given use it to prime the hash. */
+ if (build_id_seed != NULL)
+ rpmDigestUpdate(ctx, build_id_seed, strlen (build_id_seed));
+
/* Slurp the relevant header bits and section contents and feed them
into the hash function. The only bits we ignore are the offset
fields in ehdr and shdrs, since the semantically identical ELF file
@@ -1541,6 +1548,19 @@ main (int argc, char *argv[])
}
}
+ if (build_id_seed != NULL && do_build_id == 0)
+ {
+ fprintf (stderr, "--build-id-seed (-s) needs --build-id (-i)\n");
+ exit (1);
+ }
+
+ if (build_id_seed != NULL && strlen (build_id_seed) < 1)
+ {
+ fprintf (stderr,
+ "--build-id-seed (-s) string should be at least 1 char\n");
+ exit (1);
+ }
+
/* Ensure clean paths, users can muck with these */
if (base_dir)
canonicalize_path(base_dir, base_dir);
--
2.9.3

View File

@ -0,0 +1,214 @@
From 270b8627b03bc39fb008a7da1a4fd6b259ff92b8 Mon Sep 17 00:00:00 2001
Message-Id: <270b8627b03bc39fb008a7da1a4fd6b259ff92b8.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Mark Wielaard <mjw@redhat.com>
Date: Tue, 14 Jun 2016 17:07:14 +0200
Subject: [PATCH 03/11] Make adding GDB index sections configurable.
Introduces _include_gdb_index macro and -i flag to find-debuginfo.sh to
enable or disable adding a .gdb_index section to debug files. Adds tests
to make sure the .gdb_index is really added (or not) when requested.
Checks that gdb-add-index is actually installed instead of silently
failing if not. Similar for dwz.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
macros.debug | 1 +
macros.in | 8 ++++++-
scripts/find-debuginfo.sh | 29 ++++++++++++++++++----
tests/rpmbuild.at | 61 +++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 94 insertions(+), 5 deletions(-)
diff --git a/macros.debug b/macros.debug
index 6a8432e..d273c08 100644
--- a/macros.debug
+++ b/macros.debug
@@ -2,6 +2,7 @@
%_enable_debug_packages 1
%_include_minidebuginfo 1
+%_include_gdb_index 1
# Expanded at end of %install scriptlet
diff --git a/macros.in b/macros.in
index dcd0961..c845f58 100644
--- a/macros.in
+++ b/macros.in
@@ -180,7 +180,7 @@
# the script. See the script for details.
#
%__debug_install_post \
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_unique_build_ids:--ver-rel "%{version}-%{release}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{version}-%{release}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
%{nil}
# Template for debug information sub-package.
@@ -449,6 +449,12 @@ package or when debugging this package.\
#%_include_minidebuginfo 1
#
+# Include a .gdb_index section in the .debug files.
+# Requires _enable_debug_packages and gdb-add-index installed.
+#
+#%_include_gdb_index 1
+
+#
# Defines how and if build_id links are generated for ELF files.
# The following settings are supported:
#
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 2cb9570..8e60813 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -2,7 +2,7 @@
#find-debuginfo.sh - automagically generate debug info and file list
#for inclusion in an rpm spec file.
#
-# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m]
+# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m] [-i]
# [-o debugfiles.list]
# [--run-dwz] [--dwz-low-mem-die-limit N]
# [--dwz-max-die-limit N]
@@ -14,6 +14,8 @@
# The --strict-build-id flag says to exit with failure status if
# any ELF binary processed fails to contain a build-id note.
# The -r flag says to use eu-strip --reloc-debug-sections.
+# The -m flag says to include a .gnu_debugdata section in the main binary.
+# The -i flag says to include a .gdb_index section in the .debug file.
#
# A single -o switch before any -l or -p switches simply renames
# the primary output file from debugfiles.list to something else.
@@ -48,6 +50,9 @@ strip_r=false
# with -m arg, add minimal debuginfo to binary.
include_minidebug=false
+# with -i arg, add GDB index to .debug file.
+include_gdb_index=false
+
# Barf on missing build IDs.
strict=false
@@ -88,6 +93,9 @@ while [ $# -gt 0 ]; do
-m)
include_minidebug=true
;;
+ -i)
+ include_gdb_index=true
+ ;;
-o)
if [ -z "${lists[$nout]}" -a -z "${ptns[$nout]}" ]; then
out=$2
@@ -277,7 +285,15 @@ while read nlinks inum f; do
$strict && exit 2
fi
- type gdb-add-index >/dev/null 2>&1 && gdb-add-index "$f" > /dev/null 2>&1
+ # Add .gdb_index if requested.
+ if $include_gdb_index; then
+ if type gdb-add-index >/dev/null 2>&1; then
+ gdb-add-index "$f"
+ else
+ echo >&2 "*** ERROR: GDB index requested, but no gdb-add-index installed"
+ exit 2
+ fi
+ fi
# A binary already copied into /usr/lib/debug doesn't get stripped,
# just has its file names collected and adjusted.
@@ -303,7 +319,7 @@ while read nlinks inum f; do
done || exit
# Invoke the DWARF Compressor utility.
-if $run_dwz && type dwz >/dev/null 2>&1 \
+if $run_dwz \
&& [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
dwz_files="`cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug`"
if [ -n "${dwz_files}" ]; then
@@ -321,7 +337,12 @@ if $run_dwz && type dwz >/dev/null 2>&1 \
&& dwz_opts="${dwz_opts} -l ${dwz_low_mem_die_limit}"
[ -n "${dwz_max_die_limit}" ] \
&& dwz_opts="${dwz_opts} -L ${dwz_max_die_limit}"
- ( cd "${RPM_BUILD_ROOT}/usr/lib/debug" && dwz $dwz_opts $dwz_files )
+ if type dwz >/dev/null 2>&1; then
+ ( cd "${RPM_BUILD_ROOT}/usr/lib/debug" && dwz $dwz_opts $dwz_files )
+ else
+ echo >&2 "*** ERROR: DWARF compression requested, but no dwz installed"
+ exit 2
+ fi
# Remove .dwz directory if empty
rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null
if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
index 1531700..a312324 100644
--- a/tests/rpmbuild.at
+++ b/tests/rpmbuild.at
@@ -532,3 +532,64 @@ usr/local/bin/hello2
],
[ignore])
AT_CLEANUP
+
+# ------------------------------
+# Check that a GDB index is included when requested.
+AT_SETUP([rpmbuild debuginfo gdb index included])
+AT_KEYWORDS([build] [debuginfo] [gdb])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Build a package that has some debuginfo
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define "_include_gdb_index 1" \
+ -ba "${abs_srcdir}"/data/SPECS/hello2.spec
+
+# Unpack the debuginfo rpms so we can check the .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
+ | cpio -diu --quiet
+
+# Check that gdb-add-index has ran and a .gdb_index section has been added
+readelf -S ./usr/lib/debug/usr/local/bin/hello2*.debug \
+ | grep gdb_index | cut -c8-17
+],
+[0],
+[.gdb_index
+],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check that a GDB index is NOT included when not requested.
+AT_SETUP([rpmbuild debuginfo no gdb index included])
+AT_KEYWORDS([build] [debuginfo] [gdb])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Build a package that has some debuginfo
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --undefine "_include_gdb_index" \
+ -ba "${abs_srcdir}"/data/SPECS/hello2.spec
+
+# Unpack the debuginfo rpms so we can check the .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
+ | cpio -diu --quiet
+
+# Check that gdb-add-index has not ran and no .gdb_index section has been added
+readelf -S ./usr/lib/debug/usr/local/bin/hello2*.debug \
+ | grep gdb_index | cut -c8-17
+],
+[0],
+[],
+[ignore])
+AT_CLEANUP
--
2.9.3

View File

@ -0,0 +1,808 @@
From 76e637c715e13fe7f746feb29af4a6fd0de3cbc7 Mon Sep 17 00:00:00 2001
Message-Id: <76e637c715e13fe7f746feb29af4a6fd0de3cbc7.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Mark Wielaard <mjw@redhat.com>
Date: Thu, 16 Jun 2016 14:24:22 +0200
Subject: [PATCH 04/11] Add option to have unique debug file names across
version/release/arch.
Introduce a new macro _unique_debug_names that when set will pass
--unique-debug-arch "%{_arch}" to find-debuginfo.sh to create debuginfo
files which end in "-<ver>-<rel>.<arch>.debug" instead of simply ".debug".
Adds testcases for dwz and buildid with and without unique debug file names.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
build/files.c | 19 ++-
macros.debug | 3 +
macros.in | 9 +-
scripts/find-debuginfo.sh | 18 ++-
tests/rpmbuild.at | 168 +++++++++++++++++++-----
tests/rpmbuildid.at | 316 +++++++++++++++++++++++++++++++++++++++++++++-
6 files changed, 494 insertions(+), 39 deletions(-)
diff --git a/build/files.c b/build/files.c
index b010483..eb39856 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1790,6 +1790,16 @@ static int generateBuildIDs(FileList fl)
}
}
+ /* In case we need ALLDEBUG links we might need the vra as
+ tagged onto the .debug file name. */
+ char *vra = NULL;
+ if (rc == 0 && needDbg && build_id_links == BUILD_IDS_ALLDEBUG) {
+ int unique_debug_names =
+ rpmExpandNumeric("%{?_unique_debug_names}");
+ if (unique_debug_names == 1)
+ vra = rpmExpand("-%{version}-%{release}.%{_arch}", NULL);
+ }
+
/* Now add a subdir and symlink for each buildid found. */
for (i = 0; i < nr_ids; i++) {
/* Don't add anything more when an error occured. But do
@@ -1884,15 +1894,17 @@ static int generateBuildIDs(FileList fl)
int pathlen = strlen(paths[i]);
int debuglen = strlen(".debug");
int prefixlen = strlen("/usr/lib/debug");
- if (pathlen > prefixlen
- && strcmp (paths[i] + pathlen - debuglen,
+ int vralen = vra == NULL ? 0 : strlen(vra);
+ if (pathlen > prefixlen + debuglen + vralen
+ && strcmp ((paths[i] + pathlen - debuglen),
".debug") == 0) {
free(linkpath);
free(targetpath);
char *targetstr = xstrdup (paths[i]
+ prefixlen);
int targetlen = pathlen - prefixlen;
- targetstr[targetlen - debuglen] = '\0';
+ int targetend = targetlen - debuglen - vralen;
+ targetstr[targetend] = '\0';
rasprintf(&linkpath, "%s/%s",
buildidsubdir, &ids[i][2]);
rasprintf(&targetpath, "../../../../..%s",
@@ -1911,6 +1923,7 @@ static int generateBuildIDs(FileList fl)
free(paths[i]);
free(ids[i]);
}
+ free(vra);
free(paths);
free(ids);
}
diff --git a/macros.debug b/macros.debug
index d273c08..ee0cc9e 100644
--- a/macros.debug
+++ b/macros.debug
@@ -1,4 +1,7 @@
# macros to include to generate debuginfo
+# Note don't define/enable a feature here if it is already the default in
+# macros.in. Otherwise it cannot simply be --undefined on the command line
+# in the tests (it needs to be undefined multiple times then).
%_enable_debug_packages 1
%_include_minidebuginfo 1
diff --git a/macros.in b/macros.in
index c845f58..68bf391 100644
--- a/macros.in
+++ b/macros.in
@@ -180,7 +180,7 @@
# the script. See the script for details.
#
%__debug_install_post \
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{version}-%{release}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{version}-%{release}"} %{?_unique_debug_names:--unique-debug-arch "%{_arch}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
%{nil}
# Template for debug information sub-package.
@@ -488,6 +488,13 @@ package or when debugging this package.\
# onto debugedit --build-id-seed to be used to prime the build-id note hash.
%_unique_build_ids 1
+# Whether .debug files should be made unique between package version,
+# release and architecture. If set to 1 this will pass
+# --unique-debug-arch "%{_arch}" to find-debuginfo.sh to create
+# debuginfo files which end in -<ver>-<rel>.<arch>.debug
+# Requires _unique_build_ids.
+%_unique_debug_names 1
+
#
# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator 1
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 8e60813..3653c48 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -64,6 +64,9 @@ dwz_max_die_limit=
# Version and release of the spec. Given by --ver-rel
ver_rel=
+# Arch given by --unique-debug-arch
+unique_debug_arch=
+
BUILDDIR=.
out=debugfiles.list
nout=0
@@ -87,6 +90,10 @@ while [ $# -gt 0 ]; do
ver_rel=$2
shift
;;
+ --unique-debug-arch)
+ unique_debug_arch=$2
+ shift
+ ;;
-g)
strip_g=true
;;
@@ -125,6 +132,11 @@ while [ $# -gt 0 ]; do
shift
done
+if test -z "$ver_rel" -a -n "$unique_debug_arch"; then
+ echo >&2 "*** ERROR: --unique-debug-arch (${unique_debug_arch}) needs --ver-rel (${ver_rel})"
+ exit 2
+fi
+
i=0
while ((i < nout)); do
outs[$i]="$BUILDDIR/${outs[$i]}"
@@ -232,7 +244,11 @@ debug_link()
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")
- bn=$(basename "$1" .debug).debug
+ if test -n "${unique_debug_arch}"; then
+ bn=$(basename "$1" .debug)-${ver_rel}.${unique_debug_arch}.debug
+ else
+ bn=$(basename "$1" .debug).debug
+ fi
debugdn=${debugdir}${dn}
debugfn=${debugdn}/${bn}
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
index a312324..0a2c01e 100644
--- a/tests/rpmbuild.at
+++ b/tests/rpmbuild.at
@@ -386,8 +386,9 @@ AT_CLEANUP
# Check if rpmbuild runs dwz and generates a multi file that with shared
# debuginfo. This is simply the hello example with one binary build twice
# so dwz has enough slightly similar debug data.
+# Test the case without unique debug file names.
AT_SETUP([rpmbuild debuginfo dwz])
-AT_KEYWORDS([build] [debuginfo])
+AT_KEYWORDS([build] [debuginfo] [dwz])
AT_CHECK([
rm -rf ${TOPDIR}
AS_MKDIR_P(${TOPDIR}/SOURCES)
@@ -397,63 +398,170 @@ cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/he
run rpmbuild --quiet \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
+ --undefine "_unique_debug_names" \
-ba "${abs_srcdir}"/data/SPECS/hello2.spec
# The debuginfo package should contain a .debug file for each binary
# and a dwz multi file that contains the shared debuginfo between them.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
| cpio -diu
-test -f ./usr/lib/debug/usr/local/bin/hello.debug || exit 1
-test -f ./usr/lib/debug/usr/local/bin/hello2.debug || exit 1
-test -f ./usr/lib/debug/.dwz/hello2-1.0-1.* || exit 1
+
+hello_file_debug=./usr/lib/debug/usr/local/bin/hello.debug
+hello2_file_debug=./usr/lib/debug/usr/local/bin/hello2.debug
+hello_multi_file=./usr/lib/debug/.dwz/hello2-1.0-1.*
+test -f $hello_file_debug || echo "no hello debug file: $hello_file_debug"
+test -f $hello2_file_debug || echo "no hello2 debug file: $hello2_file_debug"
+test -f $hello_multi_file || echo "no dwz multi file: $hello_multi_file"
# Make sure the main package binaries contain the correct build-ids
# linking them to the debug packages.
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-1.0-1.*.rpm \
| cpio -diu
-id1=$(file ./usr/local/bin/hello | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
-id2=$(file ./usr/local/bin/hello2 | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
-id1debug=$(file ./usr/lib/debug/usr/local/bin/hello.debug \
- | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
-id2debug=$(file ./usr/lib/debug/usr/local/bin/hello2.debug \
- | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
-idmulti=$(file ./usr/lib/debug/.dwz/hello2-1.0-1.* \
- | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
-
-test "$id1" = "$id1debug" || exit 1
-test "$id2" = "$id2debug" || exit 1
+hello_file=./usr/local/bin/hello
+hello2_file=./usr/local/bin/hello2
+test -f $hello_file || echo "no hello file: $hello_file"
+test -f $hello2_file || echo "no hello2 file: $hello2_file"
+
+id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id2=$(file $hello2_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id1debug=$(file $hello_file_debug | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id2debug=$(file $hello2_file_debug | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+idmulti=$(file $hello_multi_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+test "$id1" = "$id1debug" || echo "id1: $id1 != id1debug: $id1debug"
+test "$id2" = "$id2debug" || echo "id2: $id2 != id2debug: $id2debug"
+
+# The build-id files should link to the .debug files.
+id1file="./usr/lib/debug/.build-id/${id1:0:2}/${id1:2}"
+canonid1file=$(readlink -f ${id1file})
+canonfile1=$(readlink -f $hello_file)
+canonid1debug=$(readlink -f ${id1file}.debug)
+canondebug1=$(readlink -f $hello_file_debug)
+
+test "$canonid1file" = "$canonfile1" \
+ || echo "canonid1file: $canonid1file != $canonfile1"
+test "$canonid1debug" = "$canondebug1" \
+ || echo "canonid1debug: $canonid1debug != $canondebug1"
+
+id2file="./usr/lib/debug/.build-id/${id2:0:2}/${id2:2}"
+canonid2file=$(readlink -f ${id2file})
+canonfile2=$(readlink -f $hello2_file)
+canonid2debug=$(readlink -f ${id2file}.debug)
+canondebug2=$(readlink -f $hello2_file_debug)
+
+test "$canonid2file" = "$canonfile2" \
+ || echo "canonid2: $canonid2file != $canonfile2"
+test "$canonid2debug" = "$canondebug2" \
+ || echo "canonid2debug: $canonid2debug" != "$canondebug2"
+
+# Both .debug files should point to the dwz multi file.
+# It would be nice to also test that they contain the correct dwz build-id
+# but that is a bit hard to grep out of the section data.
+multiref1=$(readelf --string-dump=.gnu_debugaltlink $hello_file_debug \
+ | grep '[ 0]' | cut -c13-)
+multiref2=$(readelf --string-dump=.gnu_debugaltlink $hello2_file_debug \
+ | grep '[ 0]' | cut -c13-)
+
+test "$multiref1" = "$multiref2" || echo "multiref: $multiref1 != $multiref2"
+
+canonmultiref=$(readlink -f $(dirname $canondebug1)/$multiref1)
+canonmultifile=$(readlink -f $hello_multi_file)
+
+test "$canonmultiref" = "$canonmultifile" \
+ || echo "canonmultiref: $canonmultiref" != "$canonmultifile"
+],
+[0],
+[],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild runs dwz and generates a multi file that with shared
+# debuginfo. This is simply the hello example with one binary build twice
+# so dwz has enough slightly similar debug data.
+# Test with unique debug file names.
+AT_SETUP([rpmbuild debuginfo dwz unique debug names])
+AT_KEYWORDS([build] [debuginfo] [dwz])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define "_unique_debug_names 1" \
+ -ba "${abs_srcdir}"/data/SPECS/hello2.spec
+
+# The debuginfo package should contain a .debug file for each binary
+# and a dwz multi file that contains the shared debuginfo between them.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
+ | cpio -diu
+
+hello_file_debug=./usr/lib/debug/usr/local/bin/hello-*.debug
+hello2_file_debug=./usr/lib/debug/usr/local/bin/hello2-*.debug
+hello_multi_file=./usr/lib/debug/.dwz/hello2-1.0-1.*
+test -f $hello_file_debug || echo "no hello debug file: $hello_file_debug"
+test -f $hello2_file_debug || echo "no hello2 debug file: $hello2_file_debug"
+test -f $hello_multi_file || echo "no dwz multi file: $hello_multi_file"
+
+# Make sure the main package binaries contain the correct build-ids
+# linking them to the debug packages.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-1.0-1.*.rpm \
+ | cpio -diu
+hello_file=./usr/local/bin/hello
+hello2_file=./usr/local/bin/hello2
+test -f $hello_file || echo "no hello file: $hello_file"
+test -f $hello2_file || echo "no hello2 file: $hello2_file"
+
+id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id2=$(file $hello2_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id1debug=$(file $hello_file_debug | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+id2debug=$(file $hello2_file_debug | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+idmulti=$(file $hello_multi_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+test "$id1" = "$id1debug" || echo "id1: $id1 != id1debug: $id1debug"
+test "$id2" = "$id2debug" || echo "id2: $id2 != id2debug: $id2debug"
# The build-id files should link to the .debug files.
id1file="./usr/lib/debug/.build-id/${id1:0:2}/${id1:2}"
canonid1file=$(readlink -f ${id1file})
-canonfile1=$(readlink -f ./usr/local/bin/hello)
+canonfile1=$(readlink -f $hello_file)
canonid1debug=$(readlink -f ${id1file}.debug)
-canondebug1=$(readlink -f ./usr/lib/debug/usr/local/bin/hello.debug)
+canondebug1=$(readlink -f $hello_file_debug)
-test "$canonid1file" = "$canonfile1" || exit 1
-test "$canonid1debug" = "$canondebug1" || exit 1
+test "$canonid1file" = "$canonfile1" \
+ || echo "canonid1file: $canonid1file != $canonfile1"
+test "$canonid1debug" = "$canondebug1" \
+ || echo "canonid1debug: $canonid1debug != $canondebug1"
id2file="./usr/lib/debug/.build-id/${id2:0:2}/${id2:2}"
-canonid2file=$(readlink -f ${id1file})
-canonfile2=$(readlink -f ./usr/local/bin/hello)
-canonid2debug=$(readlink -f ${id1file}.debug)
-canondebug2=$(readlink -f ./usr/lib/debug/usr/local/bin/hello.debug)
+canonid2file=$(readlink -f ${id2file})
+canonfile2=$(readlink -f $hello2_file)
+canonid2debug=$(readlink -f ${id2file}.debug)
+canondebug2=$(readlink -f $hello2_file_debug)
-test "$canonid2file" = "$canonfile2" || exit 1
-test "$canonid2debug" = "$canondebug2" || exit 1
+test "$canonid2file" = "$canonfile2" \
+ || echo "canonid2: $canonid2file != $canonfile2"
+test "$canonid2debug" = "$canondebug2" \
+ || echo "canonid2debug: $canonid2debug" != "$canondebug2"
# Both .debug files should point to the dwz multi file.
# It would be nice to also test that they contain the correct dwz build-id
# but that is a bit hard to grep out of the section data.
-multiref1=$(readelf --string-dump=.gnu_debugaltlink ./usr/lib/debug/usr/local/bin/hello.debug | grep '[ 0]' | cut -c13-)
-multiref2=$(readelf --string-dump=.gnu_debugaltlink ./usr/lib/debug/usr/local/bin/hello2.debug | grep '[ 0]' | cut -c13-)
+multiref1=$(readelf --string-dump=.gnu_debugaltlink $hello_file_debug \
+ | grep '[ 0]' | cut -c13-)
+multiref2=$(readelf --string-dump=.gnu_debugaltlink $hello2_file_debug \
+ | grep '[ 0]' | cut -c13-)
-test "$multiref1" = "$multiref2" || exit 1
+test "$multiref1" = "$multiref2" || echo "multiref: $multiref1 != $multiref2"
canonmultiref=$(readlink -f $(dirname $canondebug1)/$multiref1)
-canonmultifile=$(readlink -f ./usr/lib/debug/.dwz/hello2-1.0-1.*)
+canonmultifile=$(readlink -f $hello_multi_file)
-test "$canonmultiref" = "$canonmultifile" || exit 1
+test "$canonmultiref" = "$canonmultifile" \
+ || echo "canonmultiref: $canonmultiref" != "$canonmultifile"
],
[0],
[],
diff --git a/tests/rpmbuildid.at b/tests/rpmbuildid.at
index 1da6302..ede1181 100644
--- a/tests/rpmbuildid.at
+++ b/tests/rpmbuildid.at
@@ -54,7 +54,8 @@ hello debuginfo build-id files: 0
AT_CLEANUP
# ------------------------------
-# Check if rpmbuild "alldebug" generates debuginfo buildid symlinks
+# Check if rpmbuild "alldebug" generates debuginfo buildid symlinks.
+# Without unique debug file names.
AT_SETUP([rpmbuild buildid alldebug])
AT_KEYWORDS([build] [debuginfo] [buildid])
AT_CHECK([
@@ -69,6 +70,7 @@ run rpmbuild \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
--define="_build_id_links alldebug" \
+ --undefine "_unique_debug_names" \
--quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be zero build-id files in the main package
@@ -114,7 +116,100 @@ test "$canon_main_file" = "$canon_main_id_file" \
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello.debug
-test -f "${debug_file}" || echo "No debug file ${debug_file}"
+test -f ${debug_file} || echo "No debug file ${debug_file}"
+
+# Extract the build-id from the .debug file
+id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+test ${id_main} = ${id_debug} || echo "unequal main and debug id"
+
+id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
+test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
+
+canon_debug_file=$(readlink -f ${debug_file})
+
+test -f "$canon_debug_file" \
+ || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
+
+canon_debug_id_file=$(readlink -f ${id_debug_file})
+
+test -f "$canon_debug_id_file" \
+ || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
+
+test "$canon_debug_file" = "$canon_debug_id_file" \
+ || echo "debug and build-id not linked"
+],
+[0],
+[hello build-id files: 0
+hello debuginfo build-id files: 3
+],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild "alldebug" generates debuginfo buildid symlinks.
+# With unique debug file names.
+AT_SETUP([rpmbuild buildid alldebug unique debug names])
+AT_KEYWORDS([build] [debuginfo] [buildid])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Setup sources
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# Build, contains one ELF which should have a buildid.
+run rpmbuild \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define="_build_id_links alldebug" \
+ --define="_unique_debug_names 1" \
+ --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
+
+# There should be zero build-id files in the main package
+# Main and debug should be in the debuginfo package,
+# plus the .build-id/xx subdir, 3 in total.
+echo -n "hello build-id files: "
+run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
+ | grep /.build-id/ | wc --lines
+
+echo -n "hello debuginfo build-id files: "
+run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
+ | grep /.build-id/ | wc --lines
+
+# Extract the both packages to check the build-id files link to the
+# main and .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
+ | cpio -diu
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
+ | cpio -diu
+
+# Check there is a build-id symlink for the main file.
+main_file=./usr/local/bin/hello
+test -f "${main_file}" || echo "No main file ${main_file}"
+
+# Extract the build-id from the main file
+id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+id_main_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
+test -L "$id_main_file" || echo "No build-id file $id_main_file"
+
+canon_main_file=$(readlink -f ${main_file})
+
+test -f "$canon_main_file" \
+ || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
+
+canon_main_id_file=$(readlink -f ${id_main_file})
+
+test -f "$canon_main_id_file" \
+ || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
+
+test "$canon_main_file" = "$canon_main_id_file" \
+ || echo "main and build-id file not linked"
+
+# And check the same for the debug file.
+debug_file=./usr/lib/debug/usr/local/bin/hello-*.debug
+test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
@@ -146,6 +241,7 @@ AT_CLEANUP
# ------------------------------
# Check if rpmbuild "separate" generates main and debuginfo buildid symlinks
+# Without unique debug file names
AT_SETUP([rpmbuild buildid separate])
AT_KEYWORDS([build] [debuginfo] [buildid])
AT_CHECK([
@@ -160,6 +256,7 @@ run rpmbuild \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
--define="_build_id_links separate" \
+ --undefine "_unique_debug_names" \
--quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package
@@ -204,7 +301,99 @@ test "$canon_main_file" = "$canon_main_id_file" \
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello.debug
-test -f "${debug_file}" || echo "No debug file ${debug_file}"
+test -f ${debug_file} || echo "No debug file ${debug_file}"
+
+# Extract the build-id from the .debug file
+id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+test ${id_main} = ${id_debug} || echo "unequal main and debug id"
+
+id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
+test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
+
+canon_debug_file=$(readlink -f ${debug_file})
+
+test -f "$canon_debug_file" \
+ || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
+
+canon_debug_id_file=$(readlink -f ${id_debug_file})
+
+test -f "$canon_debug_id_file" \
+ || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
+
+test "$canon_debug_file" = "$canon_debug_id_file" \
+ || echo "debug and build-id not linked"
+],
+[0],
+[hello build-id files: 2
+hello debuginfo build-id files: 2
+],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild "separate" generates main and debuginfo buildid symlinks
+# With unique debug file names
+AT_SETUP([rpmbuild buildid separate unique debug names])
+AT_KEYWORDS([build] [debuginfo] [buildid])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Setup sources
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# Build, contains one ELF which should have a buildid.
+run rpmbuild \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define="_build_id_links separate" \
+ --define="_unique_debug_names 1" \
+ --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
+
+# There should be one build-id files in the main and debuginfo package
+# plus the .build-id/xx subdir, 2 in total.
+echo -n "hello build-id files: "
+run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
+ | grep /.build-id/ | wc --lines
+
+echo -n "hello debuginfo build-id files: "
+run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
+ | grep /.build-id/ | wc --lines
+
+# Extract the both packages to check the build-id files link to the
+# main and .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
+ | cpio -diu
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
+ | cpio -diu
+
+# Check there is a build-id symlink for the main file.
+main_file=./usr/local/bin/hello
+test -f "${main_file}" || echo "No main file ${main_file}"
+
+# Extract the build-id from the main file
+id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
+test -L "$id_main_file" || echo "No build-id file $id_main_file"
+
+canon_main_file=$(readlink -f ${main_file})
+
+test -f "$canon_main_file" \
+ || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
+
+canon_main_id_file=$(readlink -f ${id_main_file})
+
+test -f "$canon_main_id_file" \
+ || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
+
+test "$canon_main_file" = "$canon_main_id_file" \
+ || echo "main and build-id file not linked"
+
+# And check the same for the debug file.
+debug_file=./usr/lib/debug/usr/local/bin/hello-*.debug
+test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
@@ -236,6 +425,7 @@ AT_CLEANUP
# ------------------------------
# Check if rpmbuild "compat" generates main and debuginfo buildid symlinks
+# Without unique debug file names
AT_SETUP([rpmbuild buildid compat])
AT_KEYWORDS([build] [debuginfo] [buildid])
AT_CHECK([
@@ -250,6 +440,7 @@ run rpmbuild \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
--define="_build_id_links compat" \
+ --undefine "_unique_debug_names" \
--quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package.
@@ -295,7 +486,112 @@ test "$canon_main_file" = "$canon_main_id_file" \
# And check the same for the debug file.
debug_file=./usr/lib/debug/usr/local/bin/hello.debug
-test -f "${debug_file}" || echo "No debug file ${debug_file}"
+test -f ${debug_file} || echo "No debug file ${debug_file}"
+
+# Extract the build-id from the .debug file
+id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+test ${id_main} = ${id_debug} || echo "unequal main and debug id"
+
+id_debug_file="./usr/lib/debug/.build-id/${id_debug:0:2}/${id_debug:2}.debug"
+test -L "$id_debug_file" || echo "No build-id file $id_debug_file"
+
+canon_debug_file=$(readlink -f ${debug_file})
+
+test -f "$canon_debug_file" \
+ || echo "Cannot resolve debug file ${debug_file} -> ${canon_debug_file}"
+
+canon_debug_id_file=$(readlink -f ${id_debug_file})
+
+test -f "$canon_debug_id_file" \
+ || echo "Cannot resolve debug build-id file ${id_debug_file} -> ${canon_debug_id_file}"
+
+test "$canon_debug_file" = "$canon_debug_id_file" \
+ || echo "debug and build-id not linked"
+
+# The compat link should also point to the same (indirectly).
+id_compat_file="./usr/lib/debug/.build-id/${id_main:0:2}/${id_main:2}"
+test -L "$id_compat_file" || echo "No build-id compat file $id_compat_file"
+
+canon_compat_file=$(readlink -f ${id_compat_file})
+
+test -f "$canon_compat_file" \
+ || echo "Cannot resolve compat file ${id_compat_file} -> ${canon_compat_file}"
+
+test "$canon_compat_file" = "$canon_main_file" \
+ || echo "compat and build-id not linked"
+],
+[0],
+[hello build-id files: 2
+hello debuginfo build-id files: 3
+],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild "compat" generates main and debuginfo buildid symlinks
+# With unique debug file names
+AT_SETUP([rpmbuild buildid compat unique debug names])
+AT_KEYWORDS([build] [debuginfo] [buildid])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Setup sources
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# Build, contains one ELF which should have a buildid.
+run rpmbuild \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --define="_build_id_links compat" \
+ --define="_unique_debug_names 1" \
+ --quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
+
+# There should be one build-id files in the main and debuginfo package.
+# the debuginfo package has one extra main build-id compat symlink
+# plus the .build-id/xx subdir, 2 in total in main, 3 in total in debug
+echo -n "hello build-id files: "
+run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-1.0-1.*.rpm \
+ | grep /.build-id/ | wc --lines
+
+echo -n "hello debuginfo build-id files: "
+run rpm -ql -p "${TOPDIR}"/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
+ | grep /.build-id/ | wc --lines
+
+# Extract the both packages to check the build-id files link to the
+# main and .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
+ | cpio -diu
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-debuginfo-1.0-1.*.rpm \
+ | cpio -diu
+
+# Check there is a build-id symlink for the main file.
+main_file=./usr/local/bin/hello
+test -f "${main_file}" || echo "No main file ${main_file}"
+
+# Extract the build-id from the main file
+id_main=$(file $main_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+
+id_main_file="./usr/lib/.build-id/${id_main:0:2}/${id_main:2}"
+test -L "$id_main_file" || echo "No build-id file $id_main_file"
+
+canon_main_file=$(readlink -f ${main_file})
+
+test -f "$canon_main_file" \
+ || echo "Cannot resolve main file ${main_file} -> ${canon_main_file}"
+
+canon_main_id_file=$(readlink -f ${id_main_file})
+
+test -f "$canon_main_id_file" \
+ || echo "Cannot resolve main build-id file ${id_main_file} -> ${canon_main_id_file}"
+
+test "$canon_main_file" = "$canon_main_id_file" \
+ || echo "main and build-id file not linked"
+
+# And check the same for the debug file.
+debug_file=./usr/lib/debug/usr/local/bin/hello-*debug
+test -f ${debug_file} || echo "No debug file ${debug_file}"
# Extract the build-id from the .debug file
id_debug=$(file $debug_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
@@ -784,8 +1080,12 @@ rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
hello_file=./usr/local/bin/hello
# Extract the build-id from the main file
+test -f $hello_file || echo "No $hello_file"
id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+# Make sure we generate a new one
+rm $hello_file
+
# Build the "next" release, which has no changes except for the release update.
run rpmbuild --quiet \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
@@ -797,6 +1097,7 @@ rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
| cpio -diu --quiet
# Extract the build-id from the main file
+test -f $hello_file || echo "No $hello_file"
id2=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
if test "$id1" == "$id2"; then echo "equal $id1"; else echo "unequal"; fi
@@ -823,6 +1124,7 @@ run rpmbuild --quiet \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
--undefine="_unique_build_ids" \
+ --undefine="_unique_debug_names" \
-ba "${abs_srcdir}"/data/SPECS/hello.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
@@ -831,19 +1133,25 @@ rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
hello_file=./usr/local/bin/hello
# Extract the build-id from the main file
+test -f $hello_file || echo "No $hello_file"
id1=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
+# Make sure we generate a new one
+rm $hello_file
+
# Build the "next" release, which has no changes except for the release update.
run rpmbuild --quiet \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
--undefine="_unique_build_ids" \
+ --undefine="_unique_debug_names" \
-ba "${abs_srcdir}"/data/SPECS/hello-r2.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
| cpio -diu --quiet
# Extract the build-id from the main file
+test -f $hello_file || echo "No $hello_file"
id2=$(file $hello_file | sed 's/.*, BuildID[.*]=\(.*\),.*/\1/')
if test "$id1" == "$id2"; then echo "equal"; else echo "unequal $id1 $id2"; fi
--
2.9.3

View File

@ -0,0 +1,32 @@
From 1a8a0364fd049f3b4432633160fba12aa137f88d Mon Sep 17 00:00:00 2001
Message-Id: <1a8a0364fd049f3b4432633160fba12aa137f88d.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Mon, 3 Oct 2016 12:36:46 +0300
Subject: [PATCH 05/11] Fix behavior when %_build_id_links is undefined
Commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 tries to behave sanely
and use compat setting when %_build_id_links is undefined, but
rpmExpand() never returns NULL so the original check is incorrect.
Check for empty string instead.
---
build/files.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build/files.c b/build/files.c
index eb39856..6215bf8 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1648,7 +1648,7 @@ static int generateBuildIDs(FileList fl)
/* How are we supposed to create the build-id links? */
char *build_id_links_macro = rpmExpand("%{?_build_id_links}", NULL);
int build_id_links;
- if (build_id_links_macro == NULL) {
+ if (*build_id_links_macro == '\0') {
rpmlog(RPMLOG_WARNING,
_("_build_id_links macro not set, assuming 'compat'\n"));
build_id_links = BUILD_IDS_COMPAT;
--
2.9.3

View File

@ -0,0 +1,139 @@
From 53c9e8d00983b0d99caefc0ef94a18184c0ba85c Mon Sep 17 00:00:00 2001
Message-Id: <53c9e8d00983b0d99caefc0ef94a18184c0ba85c.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Wed, 9 Nov 2016 09:16:48 +0200
Subject: [PATCH 06/11] Fix debuginfo etc when subpackages have different
versions (RhBug:1051407)
Rpm has always been a bit dazed and confused when it comes to specs
with sub-packages having different version etc from the main package.
Many things work fine in that case .. except .. when they dont. Debuginfo
picking up wrong versions (RhBug:1051407) is just one example, there
are countless more in bugzilla wrt buildroot paths and whatnot.
The simple and sane solution would be not piling on them macros
from sub-packages, but that would surely break somebodys precious
spec tricks.
The ugly but brutally simple and compatible solution to this all is to
create separate set of macros when on the main package, this lets users
in and out of rpm pick which one (latest or main) they want. To hopefully
avoid stomping on anybodys toes, use uppercasing for the macro name (other
variants like %pkg_release are awfully commonly used). Pile 'em on, yay!
---
build/files.c | 2 +-
build/parsePreamble.c | 11 ++++++++++-
macros.in | 18 +++++++++---------
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/build/files.c b/build/files.c
index 6215bf8..2ede463 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1797,7 +1797,7 @@ static int generateBuildIDs(FileList fl)
int unique_debug_names =
rpmExpandNumeric("%{?_unique_debug_names}");
if (unique_debug_names == 1)
- vra = rpmExpand("-%{version}-%{release}.%{_arch}", NULL);
+ vra = rpmExpand("-%{VERSION}-%{RELEASE}.%{_arch}", NULL);
}
/* Now add a subdir and symlink for each buildid found. */
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 933f734..6be4403 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -909,8 +909,17 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
goto exit;
}
- if (macro)
+ if (macro) {
addMacro(spec->macros, macro, NULL, field, RMIL_SPEC);
+ /* Add a separate uppercase macro for tags from the main package */
+ if (pkg == spec->packages) {
+ char *m = xstrdup(macro);
+ for (char *p = m; *p; ++p)
+ *p = rtoupper(*p);
+ addMacro(spec->macros, m, NULL, field, RMIL_SPEC);
+ free(m);
+ }
+ }
rc = RPMRC_OK;
exit:
return rc;
diff --git a/macros.in b/macros.in
index 68bf391..4d90282 100644
--- a/macros.in
+++ b/macros.in
@@ -180,7 +180,7 @@
# the script. See the script for details.
#
%__debug_install_post \
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{version}-%{release}"} %{?_unique_debug_names:--unique-debug-arch "%{_arch}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{VERSION}-%{RELEASE}"} %{?_unique_debug_names:--unique-debug-arch "%{_arch}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
%{nil}
# Template for debug information sub-package.
@@ -232,7 +232,7 @@ package or when debugging this package.\
%_buildrootdir %{_topdir}/BUILDROOT
# Build root path, where %install installs the package during build.
-%buildroot %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
+%buildroot %{_buildrootdir}/%{NAME}-%{VERSION}-%{RELEASE}.%{_arch}
# Directory where temporaray files can be created.
%_tmppath %{_var}/tmp
@@ -484,7 +484,7 @@ package or when debugging this package.\
# Whether build-ids should be made unique between package version/releases
# when generating debuginfo packages. If set to 1 this will pass
-# --ver-rel "%{version}-%{release}" to find-debuginfo.sh which will pass it
+# --ver-rel "%{VERSION}-%{RELEASE}" to find-debuginfo.sh which will pass it
# onto debugedit --build-id-seed to be used to prime the build-id note hash.
%_unique_build_ids 1
@@ -705,9 +705,9 @@ package or when debugging this package.\
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
RPM_DOC_DIR=\"%{_docdir}\"\
export RPM_DOC_DIR\
- RPM_PACKAGE_NAME=\"%{name}\"\
- RPM_PACKAGE_VERSION=\"%{version}\"\
- RPM_PACKAGE_RELEASE=\"%{release}\"\
+ RPM_PACKAGE_NAME=\"%{NAME}\"\
+ RPM_PACKAGE_VERSION=\"%{VERSION}\"\
+ RPM_PACKAGE_RELEASE=\"%{RELEASE}\"\
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
LANG=C\
export LANG\
@@ -1146,7 +1146,7 @@ done \
%__scm_setup_hg(q)\
%{__hg} init %{-q} .\
%{__hg} add %{-q} .\
-%{__hg} commit %{-q} --user "%{__scm_author}" -m "%{name}-%{version} base"
+%{__hg} commit %{-q} --user "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
%__scm_apply_hg(qp:m:)\
%{__hg} import - %{-p:-p%{-p*}} %{-q} -m %{-m*} --user "%{__scm_author}"
@@ -1158,7 +1158,7 @@ done \
%{__git} config user.email "%{__scm_usermail}"\
%{__git} add .\
%{__git} commit %{-q} -a\\\
- --author "%{__scm_author}" -m "%{name}-%{version} base"
+ --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
%__scm_apply_git(qp:m:)\
%{__git} apply --index %{-p:-p%{-p*}} -\
@@ -1181,7 +1181,7 @@ done \
%{__bzr} init %{-q}\
%{__bzr} whoami --branch "%{__scm_author}"\
%{__bzr} add .\
-%{__bzr} commit %{-q} -m "%{name}-%{version} base"
+%{__bzr} commit %{-q} -m "%{NAME}-%{VERSION} base"
# bzr doesn't seem to have its own command to apply patches?
%__scm_apply_bzr(qp:m:)\
--
2.9.3

View File

@ -0,0 +1,53 @@
From eb21562bcec67746e756679a60995f68d7d45577 Mon Sep 17 00:00:00 2001
Message-Id: <eb21562bcec67746e756679a60995f68d7d45577.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Thu, 5 Jan 2017 12:13:54 +0200
Subject: [PATCH 07/11] Only process regular files when generating build-ids
Versioned shared libraries typically have several symlinks pointing
to them directly and indirectly. When %_build_id_links is set to compat or
separate this causes bogus warnings about duplicate build-ids.
It looks commit bbfe1f86b2e4b5c0bd499d9f3dd9de9c9c20fff2 intends to skip
symlinks since it filters on S_ISREG(), but since uses fstat()
on already open()'ed file it ends up stat()'ing the symlink target.
Flip stat() + open() around and use lstat() instead to fix it.
---
build/files.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/build/files.c b/build/files.c
index 2ede463..ca04176 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1678,11 +1678,10 @@ static int generateBuildIDs(FileList fl)
int needMain = 0;
int needDbg = 0;
for (i = 0, flp = fl->files.recs; i < fl->files.used; i++, flp++) {
- int fd;
- fd = open (flp->diskPath, O_RDONLY);
- if (fd >= 0) {
- struct stat sbuf;
- if (fstat (fd, &sbuf) == 0 && S_ISREG (sbuf.st_mode)) {
+ struct stat sbuf;
+ if (lstat(flp->diskPath, &sbuf) == 0 && S_ISREG (sbuf.st_mode)) {
+ int fd = open (flp->diskPath, O_RDONLY);
+ if (fd >= 0) {
Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
if (elf != NULL && elf_kind(elf) == ELF_K_ELF) {
const void *build_id;
@@ -1748,8 +1747,8 @@ static int generateBuildIDs(FileList fl)
}
elf_end (elf);
}
+ close (fd);
}
- close (fd);
}
}
--
2.9.3

View File

@ -0,0 +1,44 @@
From 1e38abe3e6697efcf55663060533e286e1e77ae4 Mon Sep 17 00:00:00 2001
Message-Id: <1e38abe3e6697efcf55663060533e286e1e77ae4.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Wed, 10 Aug 2016 13:58:30 +0200
Subject: [PATCH 08/11] configure.ac: use LIBDW always conditionally
References: https://bugzilla.redhat.com/show_bug.cgi?id=1365278
Reported-and-tested-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
configure.ac | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 08eceeb..5dd2bb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -368,7 +368,8 @@ AM_CONDITIONAL(WITH_ARCHIVE,[test "$with_archive" = yes])
#=================
# Check for elfutils libdw library with dwelf_elf_gnu_build_id.
-AS_IF([test "$WITH_LIBELF" = yes],[
+WITH_LIBDW_LIB=
+AS_IF([test "$WITH_LIBELF" != yes],[
AC_CHECK_HEADERS([elfutils/libdwelf.h],[
AC_CHECK_LIB(dw, dwelf_elf_gnu_build_id, [
AC_DEFINE(HAVE_LIBDW, 1,
@@ -377,9 +378,9 @@ AS_IF([test "$WITH_LIBELF" = yes],[
WITH_LIBDW=yes
])
])
- AC_SUBST(WITH_LIBDW_LIB)
- AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes])
])
+AC_SUBST(WITH_LIBDW_LIB)
+AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes])
#=================
# Process --with/without-external-db
--
2.9.3

View File

@ -0,0 +1,33 @@
From 15617bfa3d12ebe3927b130a88df6dd12ee8d0f9 Mon Sep 17 00:00:00 2001
Message-Id: <15617bfa3d12ebe3927b130a88df6dd12ee8d0f9.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 24 Aug 2016 17:06:34 +0200
Subject: [PATCH 09/11] Fix libdw configure check.
commit a82119 "configure.ac: use LIBDW always conditionally" contained
a typo that caused WITH_LIBDW_LIB never to be set when you were using
libelf. Fixed by reverting the "!=" to "=" again.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5dd2bb6..4baa3f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -369,7 +369,7 @@ AM_CONDITIONAL(WITH_ARCHIVE,[test "$with_archive" = yes])
#=================
# Check for elfutils libdw library with dwelf_elf_gnu_build_id.
WITH_LIBDW_LIB=
-AS_IF([test "$WITH_LIBELF" != yes],[
+AS_IF([test "$WITH_LIBELF" = yes],[
AC_CHECK_HEADERS([elfutils/libdwelf.h],[
AC_CHECK_LIB(dw, dwelf_elf_gnu_build_id, [
AC_DEFINE(HAVE_LIBDW, 1,
--
2.9.3

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,290 @@
From cf12c3f2c985fcaf94bb5e2b24178290f5ef09ed Mon Sep 17 00:00:00 2001
Message-Id: <cf12c3f2c985fcaf94bb5e2b24178290f5ef09ed.1488964568.git.pmatilai@redhat.com>
In-Reply-To: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
References: <189b4f88c8e100155ec23a1e0b214bdc8473532a.1488964568.git.pmatilai@redhat.com>
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 28 Feb 2017 20:45:24 +0100
Subject: [PATCH 11/11] Add option to have unique debug source dirs across
version/release/arch.
Introduce a new macro _unique_debug_srcs that when set will pass
--unique-debug-src-base "%{name}" to find-debuginfo.sh which will
move sources into a unique "<name>-<ver>-<rel>.<arch>" directory
under /usr/src/debug/ and makes debugedit rewrite the source paths
in the debuginfo to use that unique directory name.
Traditionally the debug src dir was named after the builddir which
was defined through the %setup macro which used the -n name argument
to define the builddir name and source archive to use. The builddir
might not be unique though between package versions.
Now that debugedit doesn't have strict base and dest dir length
restrictions for rewriting the source dir paths this can now be made
more flexible.
The added testcases show the difference between the old and new way.
The hello2.spec file defines the name of the package as hello2, but
uses the %setup marcro with -n hello-1.0 to use the hello-1.0.tar.gz
archive. This would traditionally result in a hello-1.0 builddir
which would be moved under /usr/src/debug. Possibly conflicting
with any other package (version) that used the same builddir name.
When defining _unique_debug_srcs to 1 that builddir will be moved
to <name>-<ver>-<rel>.<arch> instead (hello2-1.0-1.<arch>).
The testcases check that both the actual package source filess under
/usr/debug/src/ and the source paths as found in the .debug files are
under the traditional or new unique directory names depending on whether
the new _unique_debug_srcs macro is defined.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
macros.in | 8 ++++-
scripts/find-debuginfo.sh | 35 ++++++++++++++++++---
tests/rpmbuild.at | 80 +++++++++++++++++++++++++++++++++++++++++++++++
tests/rpmbuildid.at | 5 +++
4 files changed, 123 insertions(+), 5 deletions(-)
diff --git a/macros.in b/macros.in
index 4d90282..e48ef60 100644
--- a/macros.in
+++ b/macros.in
@@ -180,7 +180,7 @@
# the script. See the script for details.
#
%__debug_install_post \
- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{VERSION}-%{RELEASE}"} %{?_unique_debug_names:--unique-debug-arch "%{_arch}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
+ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_include_gdb_index:-i} %{?_unique_build_ids:--ver-rel "%{VERSION}-%{RELEASE}"} %{?_unique_debug_names:--unique-debug-arch "%{_arch}"} %{?_unique_debug_srcs:--unique-debug-src-base "%{name}"} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
%{nil}
# Template for debug information sub-package.
@@ -495,6 +495,12 @@ package or when debugging this package.\
# Requires _unique_build_ids.
%_unique_debug_names 1
+# Whether the /usr/debug/src/<package> directories should be unique between
+# package version, release and architecture. If set to 1 this will pass
+# --unique-debug-src-base "%{name}" to find-debuginfo.sh to name the
+# directory under /usr/debug/src as <name>-<ver>-<rel>.<arch>
+%_unique_debug_srcs 1
+
#
# Use internal dependency generator rather than external helpers?
%_use_internal_dependency_generator 1
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 3653c48..1420ef6 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -67,6 +67,9 @@ ver_rel=
# Arch given by --unique-debug-arch
unique_debug_arch=
+# Base given by --unique-debug-src-base
+unique_debug_src_base=
+
BUILDDIR=.
out=debugfiles.list
nout=0
@@ -94,6 +97,10 @@ while [ $# -gt 0 ]; do
unique_debug_arch=$2
shift
;;
+ --unique-debug-src-base)
+ unique_debug_src_base=$2
+ shift
+ ;;
-g)
strip_g=true
;;
@@ -137,6 +144,11 @@ if test -z "$ver_rel" -a -n "$unique_debug_arch"; then
exit 2
fi
+if test -z "$unique_debug_arch" -a -n "$unique_debug_src_base"; then
+ echo >&2 "*** ERROR: --unique-debug-src-base (${unique_debug_src_base}) needs --unique-debug-arch (${unique_debug_arch})"
+ exit 2
+fi
+
i=0
while ((i < nout)); do
outs[$i]="$BUILDDIR/${outs[$i]}"
@@ -291,7 +303,14 @@ while read nlinks inum f; do
if [ ! -z "$ver_rel" ]; then
build_id_seed="--build-id-seed=$ver_rel"
fi
- id=$(${lib_rpm_dir}/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
+ # See also cpio SOURCEFILE copy. Directories must match up.
+ debug_base_name="$RPM_BUILD_DIR"
+ debug_dest_name="/usr/src/debug"
+ if [ ! -z "$unique_debug_src_base" ]; then
+ debug_base_name="$BUILDDIR"
+ debug_dest_name="/usr/src/debug/${unique_debug_src_base}-${ver_rel}.${unique_debug_arch}"
+ fi
+ id=$(${lib_rpm_dir}/debugedit -b $debug_base_name -d $debug_dest_name \
-i $build_id_seed -l "$SOURCEFILE" "$f") || exit
if [ $nlinks -gt 1 ]; then
eval linkedid_$inum=\$id
@@ -388,11 +407,19 @@ do
done
if [ -s "$SOURCEFILE" ]; then
- mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug"
+ # See also debugedit invocation. Directories must match up.
+ debug_base_name="$RPM_BUILD_DIR"
+ debug_dest_name="/usr/src/debug"
+ if [ ! -z "$unique_debug_src_base" ]; then
+ debug_base_name="$BUILDDIR"
+ debug_dest_name="/usr/src/debug/${unique_debug_src_base}-${ver_rel}.${unique_debug_arch}"
+ fi
+
+ mkdir -p "${RPM_BUILD_ROOT}${debug_dest_name}"
LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(<internal>|<built-in>)$' |
- (cd "$RPM_BUILD_DIR"; cpio -pd0mL "${RPM_BUILD_ROOT}/usr/src/debug")
+ (cd "${debug_base_name}"; cpio -pd0mL "${RPM_BUILD_ROOT}${debug_dest_name}")
# stupid cpio creates new directories in mode 0700, fixup
- find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 |
+ find "${RPM_BUILD_ROOT}${debug_dest_name}" -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx
fi
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
index 0a2c01e..a46822f 100644
--- a/tests/rpmbuild.at
+++ b/tests/rpmbuild.at
@@ -399,6 +399,7 @@ run rpmbuild --quiet \
--macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
--rcfile=${abs_top_builddir}/rpmrc \
--undefine "_unique_debug_names" \
+ --undefine "_unique_debug_srcs" \
-ba "${abs_srcdir}"/data/SPECS/hello2.spec
# The debuginfo package should contain a .debug file for each binary
@@ -701,3 +702,82 @@ readelf -S ./usr/lib/debug/usr/local/bin/hello2*.debug \
[],
[ignore])
AT_CLEANUP
+
+# ------------------------------
+# Check that a debug source is in a "unique" directory when requested.
+AT_SETUP([rpmbuild debuginfo unique debug src dir])
+AT_KEYWORDS([build] [debuginfo])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Build a package that has some debuginfo
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# Note that the spec defines hello2 as name, but the source is hello-1.0.
+# Disable dwz to make debuginfo path rewrite checking easier.
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --undefine "_find_debuginfo_dwz_opts" \
+ --define "_unique_debug_srcs 1" \
+ -ba "${abs_srcdir}"/data/SPECS/hello2.spec
+
+# Unpack the debuginfo rpms so we can check the .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
+ | cpio -diu --quiet
+
+# Check that the source path is "unique"
+# Drop the final arch prefix to make the test arch-independent.
+ls ./usr/src/debug/ | cut -f1,2 -d\.
+
+# Check that the source path has been rewritten in the .debug file.
+# Drop the final arch prefix to make the test arch-independent.
+readelf --debug-dump=info ./usr/lib/debug/usr/local/bin/hello2*.debug \
+ | grep comp_dir | cut -f5- -d/ | cut -f1,2 -d\.
+],
+[0],
+[hello2-1.0-1
+hello2-1.0-1
+],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check that a debug source is NOT in a "unique" directory when not requested.
+# It will be in the "build directory" name under /usr/src/debug.
+AT_SETUP([rpmbuild debuginfo no unique debug src dir])
+AT_KEYWORDS([build] [debuginfo])
+AT_CHECK([
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+
+# Build a package that has some debuginfo
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz "${abs_srcdir}"/data/SOURCES/hello-1.0-modernize.patch ${TOPDIR}/SOURCES
+
+# Note that the spec defines hello2 as name, but the source is hello-1.0.
+# Disable dwz to make debuginfo path rewrite checking easier.
+run rpmbuild --quiet \
+ --macros=${abs_top_builddir}/macros:${abs_top_builddir}/tests/testing/usr/local/lib/rpm/platform/%{_target_cpu}-%{_target_os}/macros:${top_srcdir}/macros.debug \
+ --rcfile=${abs_top_builddir}/rpmrc \
+ --undefine "_find_debuginfo_dwz_opts" \
+ --undefine "_unique_debug_srcs" \
+ -ba "${abs_srcdir}"/data/SPECS/hello2.spec
+
+# Unpack the debuginfo rpms so we can check the .debug files.
+rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello2-debuginfo-1.0-1.*.rpm \
+ | cpio -diu --quiet
+
+# Check that the source path is "unique"
+ls ./usr/src/debug/
+
+# Check that the source path has been rewritten in the .debug file.
+readelf --debug-dump=info ./usr/lib/debug/usr/local/bin/hello2*.debug \
+ | grep comp_dir | cut -f5- -d/
+],
+[0],
+[hello-1.0
+hello-1.0
+],
+[ignore])
+AT_CLEANUP
diff --git a/tests/rpmbuildid.at b/tests/rpmbuildid.at
index ede1181..15c0620 100644
--- a/tests/rpmbuildid.at
+++ b/tests/rpmbuildid.at
@@ -71,6 +71,7 @@ run rpmbuild \
--rcfile=${abs_top_builddir}/rpmrc \
--define="_build_id_links alldebug" \
--undefine "_unique_debug_names" \
+ --undefine "_unique_debug_srcs" \
--quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be zero build-id files in the main package
@@ -257,6 +258,7 @@ run rpmbuild \
--rcfile=${abs_top_builddir}/rpmrc \
--define="_build_id_links separate" \
--undefine "_unique_debug_names" \
+ --undefine "_unique_debug_srcs" \
--quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package
@@ -441,6 +443,7 @@ run rpmbuild \
--rcfile=${abs_top_builddir}/rpmrc \
--define="_build_id_links compat" \
--undefine "_unique_debug_names" \
+ --undefine "_unique_debug_srcs" \
--quiet -ba "${abs_srcdir}"/data/SPECS/hello.spec
# There should be one build-id files in the main and debuginfo package.
@@ -1125,6 +1128,7 @@ run rpmbuild --quiet \
--rcfile=${abs_top_builddir}/rpmrc \
--undefine="_unique_build_ids" \
--undefine="_unique_debug_names" \
+ --undefine="_unique_debug_srcs" \
-ba "${abs_srcdir}"/data/SPECS/hello.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-1.*.rpm \
@@ -1145,6 +1149,7 @@ run rpmbuild --quiet \
--rcfile=${abs_top_builddir}/rpmrc \
--undefine="_unique_build_ids" \
--undefine="_unique_debug_names" \
+ --undefine="_unique_debug_srcs" \
-ba "${abs_srcdir}"/data/SPECS/hello-r2.spec
rpm2cpio ${abs_builddir}/testing/build/RPMS/*/hello-1.0-2.*.rpm \
--
2.9.3

View File

@ -12,4 +12,4 @@ diff -up rpm-4.9.1.1/macros.in.jx rpm-4.9.1.1/macros.in
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS\
RPM_DOC_DIR=\"%{_docdir}\"\
export RPM_DOC_DIR\
RPM_PACKAGE_NAME=\"%{name}\"\
RPM_PACKAGE_NAME=\"%{NAME}\"\

View File

@ -29,7 +29,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
Release: %{?snapver:0.%{snapver}.}3%{?dist}
Release: %{?snapver:0.%{snapver}.}4%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@ -69,11 +69,23 @@ Patch142: rpm-4.13.x-fix-refcount-for-spec_type.patch
# Fedora-specific (python3) patch (RHBZ #1405483)
Patch200: rpm-4.13.x-pythondistdeps-python3.patch
# debuginfo backports (#1427970)
Patch250: 0001-Add-build-id-links-to-rpm-for-all-ELF-files.patch
Patch251: 0002-Make-it-possible-to-have-unique-build-ids-across-bui.patch
Patch252: 0003-Make-adding-GDB-index-sections-configurable.patch
Patch253: 0004-Add-option-to-have-unique-debug-file-names-across-ve.patch
Patch254: 0005-Fix-behavior-when-_build_id_links-is-undefined.patch
Patch255: 0006-Fix-debuginfo-etc-when-subpackages-have-different-ve.patch
Patch256: 0007-Only-process-regular-files-when-generating-build-ids.patch
Patch257: 0008-configure.ac-use-LIBDW-always-conditionally.patch
Patch258: 0009-Fix-libdw-configure-check.patch
Patch259: 0010-debugedit-Support-String-Line-table-rewriting-for-la.patch
Patch260: 0011-Add-option-to-have-unique-debug-source-dirs-across-v.patch
# These are not yet upstream
Patch302: rpm-4.7.1-geode-i686.patch
# Probably to be upstreamed in slightly different form
Patch304: rpm-4.9.1.1-ld-flags.patch
Patch304: rpm-4.13.90-ldflags.patch
# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
@ -570,6 +582,9 @@ exit 0
%doc doc/librpm/html/*
%changelog
* Wed Mar 08 2017 Panu Matilainen <pmatilai@redhat.com> - 4.13.0.1-4
- Mark Wielaard's backports for debuginfo parallel installation etc (#1427970)
* Fri Feb 24 2017 Pavlina Moravcova Varekova <pmoravco@redhat.com> - 4.13.0.1-3
- Fix number of references on spec_Type (#1426578)