From 6afbaa9fdfa8dc50b3b146c1366fd9680e323fe2 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Aug 02 2018 12:52:03 +0000 Subject: [dts] [rhel7] Fix compilation by DTS gcc (RH BZ 1611582). --- diff --git a/gdb.spec b/gdb.spec index 285251f..02f3502 100644 --- a/gdb.spec +++ b/gdb.spec @@ -26,7 +26,7 @@ Version: 8.1.1 # 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: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -507,18 +507,22 @@ cd %{gdb_build}$fprofile export CFLAGS="$RPM_OPT_FLAGS %{?_with_asan:-fsanitize=address}" export LDFLAGS="%{?__global_ldflags} %{?_with_asan:-fsanitize=address}" -# DTS on RHEL-6 is using DTS GCC: 0%{?rhel} == 6 -%if 0%{?fedora} > 27 || 0%{?rhel} > 7 || 0%{?rhel} == 6 # FIXME: gcc-8.0: # ./elf32-target.h:215:4: error: cast between incompatible function types from 'void * (*)(bfd *)' {aka 'void * (*)(struct bfd *)'} to 'asymbol * (*)(bfd *, void *, long unsigned int)' {aka 'struct bfd_symbol * (*)(struct bfd *, void *, long unsigned int)'} [-Werror=cast-function-type] # ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) -CFLAGS="$CFLAGS -Wno-error=cast-function-type" +# https://bugzilla.redhat.com/show_bug.cgi?id=1611582 +# DTS on RHEL-6 is using DTS GCC which is OK; but on RHEL-7 one can use both system and DTS GCC. +if :|gcc -o /dev/null -c -x c - -Wno-error=cast-function-type;then + CFLAGS="$CFLAGS -Wno-error=cast-function-type" +fi # FIXME: gcc-8.0: # linux-tdep.c:1767:11: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 17 equals destination size [-Werror=stringop-truncation] # strncpy (p->pr_fname, basename, sizeof (p->pr_fname)); -CFLAGS="$CFLAGS -Wno-error=stringop-truncation" -%endif # 0%{?fedora} > 27 || 0%{?rhel} > 7 || 0%{?rhel} == 6 +# https://bugzilla.redhat.com/show_bug.cgi?id=1611582 +if :|gcc -o /dev/null -c -x c - -Wno-error=stringop-truncation;then + CFLAGS="$CFLAGS -Wno-error=stringop-truncation" +fi %if 0%{!?rhel:1} || 0%{?rhel} > 7 CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL" @@ -1048,6 +1052,9 @@ fi %endif %changelog +* Thu Aug 2 2018 Jan Kratochvil - 8.1.1-2.fc28 +- [dts] [rhel7] Fix compilation by DTS gcc (RH BZ 1611582). + * Wed Aug 1 2018 Sergio Durigan Junior - 8.1.1-1.fc28 - Rebase to FSF GDB 8.1.1. - Rebase gdb-rhbz881849-ipv6-3of3.patch.