From 05b22fe0aa71c81be2ee16ea07ff68b2d3eb962b Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 22 Apr 2013 16:23:49 +0200 Subject: [PATCH] [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). --- gdb-6.6-buildid-locate-rpm-scl.patch | 105 +++++++++++++++++++++++++++ gdb.spec | 11 ++- 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 gdb-6.6-buildid-locate-rpm-scl.patch diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch new file mode 100644 index 0000000..0fe8877 --- /dev/null +++ b/gdb-6.6-buildid-locate-rpm-scl.patch @@ -0,0 +1,105 @@ +warning: Skipping deprecated .gdb_index section +https://bugzilla.redhat.com/show_bug.cgi?id=953585 + +--- gdb-7.5.91.20130407-orig/gdb/dwarf2read.c 2013-04-22 15:47:18.837806752 +0200 ++++ gdb-7.5.91.20130407/gdb/dwarf2read.c 2013-04-22 16:12:55.043171881 +0200 +@@ -2700,6 +2700,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) + { +@@ -2711,6 +2719,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). It's just a performance bug, and +--- gdb-7.5.91.20130407-orig/gdb/elfread.c 2013-04-22 15:47:18.637807200 +0200 ++++ gdb-7.5.91.20130407/gdb/elfread.c 2013-04-22 16:04:09.259429034 +0200 +@@ -1674,7 +1674,7 @@ static int missing_rpm_list_entries; + /* Returns the count of newly added rpms. */ + + static int +-missing_rpm_enlist (const char *filename) ++missing_rpm_enlist_1 (const char *filename, int verify_vendor) + { + static int rpm_init_done = 0; + rpmts ts; +@@ -1778,7 +1778,7 @@ missing_rpm_enlist (const char *filename + mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0); + if (mi != NULL) + { +- for (;;) ++ if (!verify_vendor) for (;;) + { + Header h; + char *debuginfo, **slot, *s, *s2; +@@ -1897,6 +1897,35 @@ missing_rpm_enlist (const char *filename + xfree (debuginfo); + count++; + } ++ else /* verify_vendor */ ++ { ++ int vendor_pass = 0, vendor_fail = 0; ++ ++ for (;;) ++ { ++ Header h; ++ errmsg_t err; ++ char *vendor; ++ ++ h = rpmdbNextIterator_p (mi); ++ if (h == NULL) ++ break; ++ ++ vendor = headerFormat_p (h, "%{vendor}", &err); ++ if (!vendor) ++ { ++ warning (_("Error querying the rpm file `%s': %s"), filename, ++ err); ++ continue; ++ } ++ if (strcmp (vendor, "Red Hat, Inc.") == 0) ++ vendor_pass = 1; ++ else ++ vendor_fail = 1; ++ xfree (vendor); ++ } ++ count = vendor_pass != 0 && vendor_fail == 0; ++ } + + rpmdbFreeIterator_p (mi); + } +@@ -1907,6 +1936,19 @@ missing_rpm_enlist (const char *filename + } + + static int ++missing_rpm_enlist (const char *filename) ++{ ++ return missing_rpm_enlist_1 (filename, 0); ++} ++ ++extern int rpm_verify_vendor (const char *filename); ++int ++rpm_verify_vendor (const char *filename) ++{ ++ return missing_rpm_enlist_1 (filename, 1); ++} ++ ++static int + missing_rpm_list_compar (const char *const *ap, const char *const *bp) + { + return strcoll (*ap, *bp); diff --git a/gdb.spec b/gdb.spec index 34fce85..3f8601d 100644 --- a/gdb.spec +++ b/gdb.spec @@ -34,7 +34,7 @@ Version: 7.5.91.%{snap} # 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: 19%{?dist} +Release: 20%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -310,6 +310,8 @@ Patch415: gdb-6.6-buildid-locate-core-as-arg.patch # Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). #=push Patch519: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +# [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). +Patch833: gdb-6.6-buildid-locate-rpm-scl.patch # Add kernel vDSO workaround (`no loadable ...') on RHEL-5 (kernel BZ 765875). #=push @@ -886,6 +888,10 @@ find -name "*.info*"|xargs rm -f %if 0%{!?el5:1} || 0%{?scl:1} %patch393 -p1 -R %endif +%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 @@ -1380,6 +1386,9 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Mon Apr 22 2013 Jan Kratochvil - 7.5.91.20130407-20.fc19 +- [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). + * Mon Apr 22 2013 Sergio Durigan Junior - 7.5.91.20130407-19.fc19 - [RHEL-6] Regression test for RH BZ 947564.