diff --git a/bfd-change-num_group-to-unsigned-int.patch b/bfd-change-num_group-to-unsigned-int.patch new file mode 100644 index 0000000..7c19bf7 --- /dev/null +++ b/bfd-change-num_group-to-unsigned-int.patch @@ -0,0 +1,42 @@ +bfd: Change num_group to unsigned int + +elf.c failed with to with GCC 10 as of + +commit 906b3eb9df6c577d3f6e9c3ea5c9d7e4d1e90536 +Author: Martin Liska +Date: Tue Mar 24 11:40:10 2020 +0100 + + Improve endianess detection. + + PR lto/94249 + * plugin-api.h: Add more robust endianess detection. + +binutils-gdb/bfd/elf.c: In function ‘setup_group’: +binutils-gdb/bfd/elf.c:740:35: error: overflow in conversion from ‘unsigned int’ to ‘int’ changes value from ‘num_group = 4294967295’ to ‘-1’ [-Werror=overflow] + 740 | elf_tdata (abfd)->num_group = num_group = -1; + | ^~~~~~~~~ +cc1: all warnings being treated as errors +make[2]: *** [Makefile:1608: elf.lo] Error 1 + +Change num_group in elf_obj_tdata to unsigned int to compile with GCC 10. + + PR binutils/25717 + * elf-bfd.h (elf_obj_tdata): Change num_group to unsigned int. + +--- + bfd/elf-bfd.h | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h +index c546b583b8..5f3a5cc04b 100644 +--- a/bfd/elf-bfd.h ++++ b/bfd/elf-bfd.h +@@ -1953,7 +1953,7 @@ struct elf_obj_tdata + struct sdt_note *sdt_note_head; + + Elf_Internal_Shdr **group_sect_ptr; +- int num_group; ++ unsigned int num_group; + + /* Index into group_sect_ptr, updated by setup_group when finding a + section's group. Used to optimize subsequent group searches. */ diff --git a/gdb.changes b/gdb.changes index 578fa3f..c8b6568 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 14 07:40:12 UTC 2020 - Tom de Vries + +- Fix build with gcc 10 [bsc#1169368, swo#25717]. + * bfd-change-num_group-to-unsigned-int.patch + ------------------------------------------------------------------- Tue Feb 4 19:56:55 UTC 2020 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index 5c75abf..1dfced0 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,7 +1,7 @@ # # spec file for package gdb # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2012 RedHat # # All modifications and additions to the file contributed by third parties @@ -39,7 +39,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build # Do not provide URL for snapshots as the file lasts there only for 2 days. # ftp://sourceware.org/pub/gdb/releases/gdb-%%{version}.tar.gz Source: gdb-%{version}.tar.bz2 -Url: http://gnu.org/software/gdb/ +URL: http://gnu.org/software/gdb/ %if "%{scl}" == "devtoolset-1.1" Obsoletes: devtoolset-1.0-%{pkg_name} @@ -251,6 +251,7 @@ Patch2012: gdb-0001-remove-alloca-0-calls.patch Patch2013: gdb-arch13-1.diff Patch2014: gdb-arch13-2.diff Patch2015: gdb-arch13-3.diff +Patch2016: bfd-change-num_group-to-unsigned-int.patch # Proposed patch for PR symtab/24971 Patch2500: gdb-symtab-prefer-var-def-over-decl.patch @@ -610,6 +611,7 @@ find -name "*.info*"|xargs rm -f %patch2013 -p1 %patch2014 -p1 %patch2015 -p1 +%patch2016 -p1 %patch2500 -p1 %patch2501 -p1