1 |
commit: 5ea5abd9862ba73faa75e620e1055818fed794c7 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 29 06:56:21 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 29 06:56:21 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5ea5abd9 |
7 |
|
8 |
4.6.4: backport gperf-gnu-inline patch |
9 |
|
10 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
11 |
|
12 |
4.6.4/gentoo/96_all_gcc-gperf-gnu-inline.patch | 64 ++++++++++++++++++++++++++ |
13 |
4.6.4/gentoo/README.history | 1 + |
14 |
2 files changed, 65 insertions(+) |
15 |
|
16 |
diff --git a/4.6.4/gentoo/96_all_gcc-gperf-gnu-inline.patch b/4.6.4/gentoo/96_all_gcc-gperf-gnu-inline.patch |
17 |
new file mode 100644 |
18 |
index 0000000..b26647a |
19 |
--- /dev/null |
20 |
+++ b/4.6.4/gentoo/96_all_gcc-gperf-gnu-inline.patch |
21 |
@@ -0,0 +1,64 @@ |
22 |
+https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html |
23 |
+ |
24 |
+From 1de9842cba4749376b545a09ef0b4fc195d319a6 Mon Sep 17 00:00:00 2001 |
25 |
+From: Mike Frysinger <vapier@g.o> |
26 |
+Date: Thu, 6 Aug 2015 23:32:54 -0400 |
27 |
+Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes |
28 |
+ |
29 |
+Since the 3.0.3 release of gperf (made in May 2007), the generated func |
30 |
+has had the gnu_inline attribute applied to it. The gcc source however |
31 |
+has not been updated to include that which has lead to a mismatch. |
32 |
+ |
33 |
+In practice, this hasn't been an issue for two reasons: |
34 |
+(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not |
35 |
+warn or throw an error in this mode. |
36 |
+(2) Starting with gcc-4.8, the compiler driver used to build gcc was |
37 |
+changed to C++, and g++ does not warn or throw an error in this mode. |
38 |
+ |
39 |
+This error does show up though when using gcc-5 to build gcc-4.7 or |
40 |
+older as then the default is (gnu) C11 and the C compiler driver is |
41 |
+used. That failure looks like: |
42 |
+In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0: |
43 |
+cfns.gperf: At top level: |
44 |
+cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p' |
45 |
+cfns.gperf:26:14: error: but not here |
46 |
+ |
47 |
+Whether the compiler should always emit this error regardless of the |
48 |
+active standard or compiler driver is debatable (I think it should be |
49 |
+consistent -- either always do it or never do it). |
50 |
+--- |
51 |
+ gcc/cp/cfns.gperf | 3 +++ |
52 |
+ gcc/cp/cfns.h | 3 +++ |
53 |
+ 2 files changed, 6 insertions(+) |
54 |
+ |
55 |
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf |
56 |
+index 68acd3d..953262f 100644 |
57 |
+--- a/gcc/cp/cfns.gperf |
58 |
++++ b/gcc/cp/cfns.gperf |
59 |
+@@ -22,6 +22,9 @@ __inline |
60 |
+ static unsigned int hash (const char *, unsigned int); |
61 |
+ #ifdef __GNUC__ |
62 |
+ __inline |
63 |
++#ifdef __GNUC_STDC_INLINE__ |
64 |
++__attribute__ ((__gnu_inline__)) static |
65 |
++#endif |
66 |
+ #endif |
67 |
+ const char * libc_name_p (const char *, unsigned int); |
68 |
+ %} |
69 |
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h |
70 |
+index 1c6665d..6d00c0e 100644 |
71 |
+--- a/gcc/cp/cfns.h |
72 |
++++ b/gcc/cp/cfns.h |
73 |
+@@ -53,6 +53,9 @@ __inline |
74 |
+ static unsigned int hash (const char *, unsigned int); |
75 |
+ #ifdef __GNUC__ |
76 |
+ __inline |
77 |
++#ifdef __GNUC_STDC_INLINE__ |
78 |
++__attribute__ ((__gnu_inline__)) static |
79 |
++#endif |
80 |
+ #endif |
81 |
+ const char * libc_name_p (const char *, unsigned int); |
82 |
+ /* maximum key range = 391, duplicates = 0 */ |
83 |
+-- |
84 |
+2.4.4 |
85 |
+ |
86 |
|
87 |
diff --git a/4.6.4/gentoo/README.history b/4.6.4/gentoo/README.history |
88 |
index 49ed8ec..af8339f 100644 |
89 |
--- a/4.6.4/gentoo/README.history |
90 |
+++ b/4.6.4/gentoo/README.history |
91 |
@@ -1,5 +1,6 @@ |
92 |
1.5 TODO |
93 |
+ 95_all_libjava-ucontext.patch |
94 |
+ + 96_all_gcc-gperf-gnu-inline.patch |
95 |
|
96 |
1.4 23 Sep 2018 |
97 |
- 10_all_default-fortify-source.patch |