Accepting request 793841 from home:tomdevries:branches:devel:gcc-gdb-gcc-10-build-woverflow

- Fix build with gcc 10 [bsc#1169368, swo#25717].
  * bfd-change-num_group-to-unsigned-int.patch

OBS-URL: https://build.opensuse.org/request/show/793841
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=245
This commit is contained in:
Michael Matz 2020-04-14 12:14:23 +00:00 committed by Git OBS Bridge
parent 237b37f6cc
commit bb16f5ec91
3 changed files with 52 additions and 2 deletions

View File

@ -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 <mliska@suse.cz>
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. */

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 14 07:40:12 UTC 2020 - Tom de Vries <tdevries@suse.com>
- 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 <tdevries@suse.com>

View File

@ -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