[gdb] Fix gcc5 compilation errors (RH BZ 1190649).

Jan Kratochvil jankratochvil at fedoraproject.org
Wed Feb 11 14:31:18 UTC 2015


commit 5d84d7a16acc0469b6829f276987cf74e10ae848
Author: Jan Kratochvil <jan.kratochvil at redhat.com>
Date:   Wed Feb 11 15:31:05 2015 +0100

    Fix gcc5 compilation errors (RH BZ 1190649).

 gdb-upstream.patch              |   53 +++++++++++++++++++++++++++++++++++++++
 gdb-vla-intel-logical-not.patch |   11 ++++++++
 gdb.spec                        |   11 ++++++--
 3 files changed, 72 insertions(+), 3 deletions(-)
---
diff --git a/gdb-upstream.patch b/gdb-upstream.patch
new file mode 100644
index 0000000..3116a53
--- /dev/null
+++ b/gdb-upstream.patch
@@ -0,0 +1,53 @@
+commit 7a270e0c9ba0eb738a4c30258ab29c09963fcd4d
+Author: Alexander Klimov <alserkli at inbox.ru>
+Date:   Tue Jan 27 19:56:45 2015 +0200
+
+    Fix build failure in symfile.c::unmap_overlay_command (GCC5 bug)
+    
+    Compilation of (GDB) 7.9.50.20150127-cvs with (GCC) 5.0.0 20150127
+    fails with
+    
+    In file included from symfile.c:32:0:
+    symfile.c: In function 'unmap_overlay_command':
+    objfiles.h:628:3: error: 'sec' may be used uninitialized in this
+    function [-Werror=maybe-uninitialized]
+       for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
+       ^
+    symfile.c:3442:23: note: 'sec' was declared here
+       struct obj_section *sec;
+                           ^
+    cc1: all warnings being treated as errors
+    make[2]: *** [symfile.o] Error 1
+    make[2]: Leaving directory `gdb/gdb'
+    
+    While the bug was reported to GCC as
+    <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823>,
+    the attached patch simply initializes sec with NULL.
+    
+    gdb/ChangeLog:
+    
+            * symfile.c (unmap_overlay_command): Initialize sec to NULL.
+    
+    Tested on x86_64-linux.
+
+### a/gdb/ChangeLog
+### b/gdb/ChangeLog
+## -1,3 +1,7 @@
++2015-01-29  Joel Brobecker  <brobecker at adacore.com>  (tiny patch)
++
++	* symfile.c (unmap_overlay_command): Initialize sec to NULL.
++
+ 2015-01-27  Doug Evans  <dje at google.com>
+ 
+ 	* NEWS: Mention gdb.Objfile.username.
+--- a/gdb/symfile.c
++++ b/gdb/symfile.c
+@@ -3439,7 +3439,7 @@ static void
+ unmap_overlay_command (char *args, int from_tty)
+ {
+   struct objfile *objfile;
+-  struct obj_section *sec;
++  struct obj_section *sec = NULL;
+ 
+   if (!overlay_debugging)
+     error (_("Overlay debugging not enabled.  "
diff --git a/gdb-vla-intel-logical-not.patch b/gdb-vla-intel-logical-not.patch
new file mode 100644
index 0000000..0c51c84
--- /dev/null
+++ b/gdb-vla-intel-logical-not.patch
@@ -0,0 +1,11 @@
+--- ./gdb/value.c-orig	2015-02-11 15:17:58.413241779 +0100
++++ ./gdb/value.c	2015-02-11 15:19:42.068716949 +0100
+@@ -3074,7 +3074,7 @@ value_primitive_field (struct value *arg
+ 	}
+ 
+       if (!TYPE_DATA_LOCATION (type)
+-          || !TYPE_DATA_LOCATION_KIND (type) == PROP_CONST)
++          || TYPE_DATA_LOCATION_KIND (type) != PROP_CONST)
+ 	v->offset = (value_offset (arg1) + offset
+ 		     + value_embedded_offset (arg1));
+     }
diff --git a/gdb.spec b/gdb.spec
index c1a54b4..53c0ede 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -26,7 +26,7 @@ Version: 7.8.90.20150202
 
 # 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: 3%{?dist}
+Release: 4%{?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
@@ -221,7 +221,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
 
 # Backported fixups post the source tarball.
 #Xdrop: Just backports.
-#Patch232: gdb-upstream.patch
+Patch232: gdb-upstream.patch
 
 # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
 #=fedoratest+ppc
@@ -509,6 +509,7 @@ Patch852: gdb-gnat-dwarf-crash-3of3.patch
 
 # VLA (Fortran dynamic arrays) from Intel + archer-jankratochvil-vla tests.
 Patch888: gdb-vla-intel.patch
+Patch983: gdb-vla-intel-logical-not.patch
 Patch889: gdb-vla-intel-stringbt-fix.patch
 Patch912: gdb-vla-intel-04of23-fix.patch
 Patch887: gdb-archer-vla-tests.patch
@@ -707,9 +708,10 @@ find -name "*.info*"|xargs rm -f
 # Match the Fedora's version info.
 %patch2 -p1
 
-#patch232 -p1
+%patch232 -p1
 %patch349 -p1
 %patch888 -p1
+%patch983 -p1
 %patch889 -p1
 %patch912 -p1
 %patch1 -p1
@@ -1316,6 +1318,9 @@ then
 fi
 
 %changelog
+* Wed Feb 11 2015 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.8.90.20150202-4.fc22
+- Fix gcc5 compilation errors (RH BZ 1190649).
+
 * Mon Feb  9 2015 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.8.90.20150202-3.fc22
 - Require gcc-gdb-plugin.
 


More information about the scm-commits mailing list