From 46cc044291e53d88055c24c46aabd08dbc0456d6 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 9 Jan 2016 14:46:42 +0100 Subject: [PATCH] Simplify .spec: Remove conditional revert of: gdb-6.6-buildid-locate-rpm-scl.patch --- gdb-6.6-buildid-locate-rpm-scl.patch | 88 ++++++++++++++++------------ gdb.spec | 15 +++-- 2 files changed, 60 insertions(+), 43 deletions(-) diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch index d5533e8..f2f605d 100644 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -1,60 +1,38 @@ warning: Skipping deprecated .gdb_index section https://bugzilla.redhat.com/show_bug.cgi?id=953585 -Index: gdb-7.6.90.20140127/gdb/dwarf2read.c -=================================================================== ---- gdb-7.6.90.20140127.orig/gdb/dwarf2read.c 2014-02-06 18:28:23.756232026 +0100 -+++ gdb-7.6.90.20140127/gdb/dwarf2read.c 2014-02-06 18:28:48.969259122 +0100 -@@ -3035,6 +3035,14 @@ read_index_from_section (struct objfile - "set use-deprecated-index-sections on". */ - if (version < 6 && !deprecated_ok) - { -+ extern int rpm_verify_vendor (const char *filename); -+ -+ /* Red Hat Developer Toolset exception. */ -+ if (rpm_verify_vendor (filename)) -+ {} -+ else -+ { -+ - static int warning_printed = 0; - if (!warning_printed) - { -@@ -3046,6 +3054,8 @@ to use the section anyway."), - warning_printed = 1; - } - return 0; -+ -+ } - } - /* Version 7 indices generated by gold refer to the CU for a symbol instead - of the TU (for symbols coming from TUs), -Index: gdb-7.6.90.20140127/gdb/build-id.c -=================================================================== ---- gdb-7.6.90.20140127.orig/gdb/build-id.c 2014-02-06 18:28:23.758232029 +0100 -+++ gdb-7.6.90.20140127/gdb/build-id.c 2014-02-06 18:28:26.814235312 +0100 -@@ -711,7 +711,7 @@ static int missing_rpm_list_entries; +diff -dup -rup gdb-7.10.50.20160106-orig/gdb/build-id.c gdb-7.10.50.20160106/gdb/build-id.c +--- gdb-7.10.50.20160106-orig/gdb/build-id.c 2016-01-09 14:40:39.420385241 +0100 ++++ gdb-7.10.50.20160106/gdb/build-id.c 2016-01-09 14:41:05.944549393 +0100 +@@ -713,7 +713,11 @@ static int missing_rpm_list_entries; /* Returns the count of newly added rpms. */ static int --missing_rpm_enlist (const char *filename) ++#ifndef GDB_INDEX_VERIFY_VENDOR + missing_rpm_enlist (const char *filename) ++#else +missing_rpm_enlist_1 (const char *filename, int verify_vendor) ++#endif { static int rpm_init_done = 0; rpmts ts; -@@ -815,7 +815,7 @@ missing_rpm_enlist (const char *filename +@@ -817,7 +821,11 @@ missing_rpm_enlist (const char *filename mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); if (mi != NULL) { -- for (;;) ++#ifndef GDB_INDEX_VERIFY_VENDOR + for (;;) ++#else + if (!verify_vendor) for (;;) ++#endif { Header h; char *debuginfo, **slot, *s, *s2; -@@ -933,6 +933,35 @@ missing_rpm_enlist (const char *filename +@@ -935,6 +943,37 @@ missing_rpm_enlist (const char *filename xfree (debuginfo); count++; } ++#ifdef GDB_INDEX_VERIFY_VENDOR + else /* verify_vendor */ + { + int vendor_pass = 0, vendor_fail = 0; @@ -84,13 +62,15 @@ Index: gdb-7.6.90.20140127/gdb/build-id.c + } + count = vendor_pass != 0 && vendor_fail == 0; + } ++#endif rpmdbFreeIterator_p (mi); } -@@ -943,6 +972,19 @@ missing_rpm_enlist (const char *filename +@@ -945,6 +984,21 @@ missing_rpm_enlist (const char *filename } static int ++#ifdef GDB_INDEX_VERIFY_VENDOR +missing_rpm_enlist (const char *filename) +{ + return missing_rpm_enlist_1 (filename, 0); @@ -104,6 +84,38 @@ Index: gdb-7.6.90.20140127/gdb/build-id.c +} + +static int ++#endif missing_rpm_list_compar (const char *const *ap, const char *const *bp) { return strcoll (*ap, *bp); +diff -dup -rup gdb-7.10.50.20160106-orig/gdb/dwarf2read.c gdb-7.10.50.20160106/gdb/dwarf2read.c +--- gdb-7.10.50.20160106-orig/gdb/dwarf2read.c 2016-01-09 14:40:39.416385216 +0100 ++++ gdb-7.10.50.20160106/gdb/dwarf2read.c 2016-01-09 14:41:05.942549381 +0100 +@@ -3111,6 +3111,16 @@ read_index_from_section (struct objfile + "set use-deprecated-index-sections on". */ + if (version < 6 && !deprecated_ok) + { ++#ifdef GDB_INDEX_VERIFY_VENDOR ++ extern int rpm_verify_vendor (const char *filename); ++ ++ /* Red Hat Developer Toolset exception. */ ++ if (rpm_verify_vendor (filename)) ++ {} ++ else ++ { ++ ++#endif + static int warning_printed = 0; + if (!warning_printed) + { +@@ -3122,6 +3132,10 @@ to use the section anyway."), + warning_printed = 1; + } + return 0; ++#ifdef GDB_INDEX_VERIFY_VENDOR ++ ++ } ++#endif + } + /* Version 7 indices generated by gold refer to the CU for a symbol instead + of the TU (for symbols coming from TUs), diff --git a/gdb.spec b/gdb.spec index c6aa789..370c9b5 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,7 +27,7 @@ Version: 7.10.50.%{snapsrc} # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 37%{?dist} +Release: 38%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -879,11 +879,8 @@ find -name "*.info*"|xargs rm -f %patch1067 -p1 %patch1070 -p1 %patch848 -p1 - %patch833 -p1 -%if 0%{!?el6:1} || 0%{!?scl:1} -%patch833 -p1 -R -%endif + %patch642 -p1 %if 0%{?rhel:1} && 0%{?rhel} <= 6 %patch642 -p1 -R @@ -955,6 +952,11 @@ export LDFLAGS="%{?__global_ldflags} %{?_with_asan:-fsanitize=address}" CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL" %endif +# Patch833: gdb-6.6-buildid-locate-rpm-scl.patch +%if 0%{?el6:1} && 0%{?scl:1} +CFLAGS="$CFLAGS -DGDB_INDEX_VERIFY_VENDOR" +%endif + # --htmldir and --pdfdir are not used as they are used from %{gdb_build}. ../configure \ --prefix=%{_prefix} \ @@ -1397,6 +1399,9 @@ then fi %changelog +* Sat Jan 9 2016 Jan Kratochvil - 7.10.50.20160106-38.fc24 +- Simplify .spec: Remove conditional revert of: gdb-6.6-buildid-locate-rpm-scl.patch + * Sat Jan 9 2016 Jan Kratochvil - 7.10.50.20160106-37.fc24 - Simplify .spec: Remove conditional revert of: gdb-dts-rhel6-python-compat.patch