gnu: xorg-server: Fix CVE-2017-{10971,10972}.
[jackhill/guix/guix.git] / gnu / packages / patches / gcc-4.6-gnu-inline.patch
CommitLineData
db90eb8c
RW
1This patch was taken from https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html.
2It is used by propeller-gcc-4.
3
4Since the 3.0.3 release of gperf (made in May 2007), the generated func
5has had the gnu_inline attribute applied to it. The gcc source however
6has not been updated to include that which has lead to a mismatch.
7
8In practice, this hasn't been an issue for two reasons:
9(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
10warn or throw an error in this mode.
11(2) Starting with gcc-4.8, the compiler driver used to build gcc was
12changed to C++, and g++ does not warn or throw an error in this mode.
13
14This error does show up though when using gcc-5 to build gcc-4.7 or
15older as then the default is (gnu) C11 and the C compiler driver is
16used. That failure looks like:
17In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
18cfns.gperf: At top level:
19cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
20cfns.gperf:26:14: error: but not here
21
22Whether the compiler should always emit this error regardless of the
23active standard or compiler driver is debatable (I think it should be
24consistent -- either always do it or never do it).
25
262015-08-06 Mike Frysinger <vapier@gentoo.org>
27
28 * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the
29 __gnu_inline__ attribute.
30 * cfns.h: Regenerated.
31---
32 gcc/cp/cfns.gperf | 3 +++
33 gcc/cp/cfns.h | 3 +++
34 2 files changed, 6 insertions(+)
35
36diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
37index 68acd3d..953262f 100644
38--- a/gcc/cp/cfns.gperf
39+++ b/gcc/cp/cfns.gperf
40@@ -22,6 +22,9 @@ __inline
41 static unsigned int hash (const char *, unsigned int);
42 #ifdef __GNUC__
43 __inline
44+#ifdef __GNUC_STDC_INLINE__
45+__attribute__ ((__gnu_inline__))
46+#endif
47 #endif
48 const char * libc_name_p (const char *, unsigned int);
49 %}
50diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
51index 1c6665d..6d00c0e 100644
52--- a/gcc/cp/cfns.h
53+++ b/gcc/cp/cfns.h
54@@ -53,6 +53,9 @@ __inline
55 static unsigned int hash (const char *, unsigned int);
56 #ifdef __GNUC__
57 __inline
58+#ifdef __GNUC_STDC_INLINE__
59+__attribute__ ((__gnu_inline__))
60+#endif
61 #endif
62 const char * libc_name_p (const char *, unsigned int);
63 /* maximum key range = 391, duplicates = 0 */
64--
652.4.4