Commit | Line | Data |
---|---|---|
db90eb8c RW |
1 | This patch was taken from https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html. |
2 | It is used by propeller-gcc-4. | |
3 | ||
4 | Since the 3.0.3 release of gperf (made in May 2007), the generated func | |
5 | has had the gnu_inline attribute applied to it. The gcc source however | |
6 | has not been updated to include that which has lead to a mismatch. | |
7 | ||
8 | In 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 | |
10 | warn or throw an error in this mode. | |
11 | (2) Starting with gcc-4.8, the compiler driver used to build gcc was | |
12 | changed to C++, and g++ does not warn or throw an error in this mode. | |
13 | ||
14 | This error does show up though when using gcc-5 to build gcc-4.7 or | |
15 | older as then the default is (gnu) C11 and the C compiler driver is | |
16 | used. That failure looks like: | |
17 | In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0: | |
18 | cfns.gperf: At top level: | |
19 | cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p' | |
20 | cfns.gperf:26:14: error: but not here | |
21 | ||
22 | Whether the compiler should always emit this error regardless of the | |
23 | active standard or compiler driver is debatable (I think it should be | |
24 | consistent -- either always do it or never do it). | |
25 | ||
26 | 2015-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 | ||
36 | diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf | |
37 | index 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 | %} | |
50 | diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h | |
51 | index 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 | -- | |
65 | 2.4.4 |