vapier      15/08/07 04:08:24

  Modified:             README.history
  Added:                72_all_gcc-gperf-gnu-inline.patch
  Log:
  fix building w/gcc-5+ due to mismatch in gnu_inline attributes

Revision  Changes    Path
1.17                 src/patchsets/gcc/4.7.2/gentoo/README.history

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?rev=1.17&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?rev=1.17&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?r1=1.16&r2=1.17

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- README.history      23 Apr 2015 15:30:33 -0000      1.16
+++ README.history      7 Aug 2015 04:08:24 -0000       1.17
@@ -1,6 +1,7 @@
 1.7            [pending]
        + 18_all_libgcc-cross-canadian.patch
        U 67_all_gcc-poison-system-directories.patch
+       + 72_all_gcc-gperf-gnu-inline.patch
        - 74_all_gcc46_cloog-dl.patch
        - 90_all_gcc-4.7-x32.patch
 



1.1                  
src/patchsets/gcc/4.7.2/gentoo/72_all_gcc-gperf-gnu-inline.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/72_all_gcc-gperf-gnu-inline.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/72_all_gcc-gperf-gnu-inline.patch?rev=1.1&content-type=text/plain

Index: 72_all_gcc-gperf-gnu-inline.patch
===================================================================
https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html

>From 1de9842cba4749376b545a09ef0b4fc195d319a6 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vap...@gentoo.org>
Date: Thu, 6 Aug 2015 23:32:54 -0400
Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes

Since the 3.0.3 release of gperf (made in May 2007), the generated func
has had the gnu_inline attribute applied to it.  The gcc source however
has not been updated to include that which has lead to a mismatch.

In practice, this hasn't been an issue for two reasons:
(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
warn or throw an error in this mode.
(2) Starting with gcc-4.8, the compiler driver used to build gcc was
changed to C++, and g++ does not warn or throw an error in this mode.

This error does show up though when using gcc-5 to build gcc-4.7 or
older as then the default is (gnu) C11 and the C compiler driver is
used.  That failure looks like:
In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
cfns.gperf: At top level:
cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
cfns.gperf:26:14: error: but not here

Whether the compiler should always emit this error regardless of the
active standard or compiler driver is debatable (I think it should be
consistent -- either always do it or never do it).
---
 gcc/cp/cfns.gperf | 3 +++
 gcc/cp/cfns.h     | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
index 68acd3d..953262f 100644
--- a/gcc/cp/cfns.gperf
+++ b/gcc/cp/cfns.gperf
@@ -22,6 +22,9 @@ __inline
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 %}
diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
index 1c6665d..6d00c0e 100644
--- a/gcc/cp/cfns.h
+++ b/gcc/cp/cfns.h
@@ -53,6 +53,9 @@ __inline
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 /* maximum key range = 391, duplicates = 0 */
-- 
2.4.4





Reply via email to