diff options
| author | Ioan-Adrian Ratiu <adrian.ratiu@ni.com> | 2016-05-18 11:10:52 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-18 20:50:30 +0100 |
| commit | eff84a76acea1a0842194106a66684511f409842 (patch) | |
| tree | b1999b2cb24c34799be72edb40021289dd0181d2 /meta/recipes-devtools | |
| parent | e8898f018862e7e398ea84732a11630e30fb2ceb (diff) | |
| download | poky-eff84a76acea1a0842194106a66684511f409842.tar.gz | |
gcc-4.9: fix build with gcc 6
Building gcc-cross 4.9.3 with gcc 6 fails with the following error:
error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline with 'gnu_inline' attribute
This is a backport of the upstream fix.
(From OE-Core rev: 178c1253c4e50d287476436abc92781fa96ef4fc)
Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.9.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch | 151 |
2 files changed, 152 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc index 208e092e1d..0cd9826577 100644 --- a/meta/recipes-devtools/gcc/gcc-4.9.inc +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc | |||
| @@ -91,6 +91,7 @@ SRC_URI = "\ | |||
| 91 | file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \ | 91 | file://0073-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \ |
| 92 | file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \ | 92 | file://0074-fdebug-prefix-map-support-to-remap-relative-path.patch \ |
| 93 | file://0075-libgcc-use-ldflags.patch \ | 93 | file://0075-libgcc-use-ldflags.patch \ |
| 94 | file://0076-Fix-build-with-gcc-6.patch \ | ||
| 94 | " | 95 | " |
| 95 | SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327" | 96 | SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327" |
| 96 | SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e" | 97 | SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e" |
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch new file mode 100644 index 0000000000..f865d4f478 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.9/0076-Fix-build-with-gcc-6.patch | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | From efdf2b53b907c96ad3f00275588eb311335d0c91 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> | ||
| 3 | Date: Thu, 12 May 2016 15:24:25 +0300 | ||
| 4 | Subject: [PATCH] Fix build with gcc 6 | ||
| 5 | |||
| 6 | * Make-lang.in: Invoke gperf with -L C++. | ||
| 7 | * cfns.gperf: Remove prototypes for hash and libc_name_p | ||
| 8 | inlines. | ||
| 9 | * cfns.h: Regenerated. | ||
| 10 | * except.c (nothrow_libfn_p): Adjust. | ||
| 11 | |||
| 12 | svn rev: r233572 | ||
| 13 | |||
| 14 | Upstream-status: Backport [gcc 4.9] | ||
| 15 | |||
| 16 | Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> | ||
| 17 | --- | ||
| 18 | gcc/cp/Make-lang.in | 2 +- | ||
| 19 | gcc/cp/cfns.gperf | 10 ++-------- | ||
| 20 | gcc/cp/cfns.h | 41 ++++++++++++++--------------------------- | ||
| 21 | gcc/cp/except.c | 3 ++- | ||
| 22 | 4 files changed, 19 insertions(+), 37 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in | ||
| 25 | index bd1c1d7..a0ea0d4 100644 | ||
| 26 | --- a/gcc/cp/Make-lang.in | ||
| 27 | +++ b/gcc/cp/Make-lang.in | ||
| 28 | @@ -111,7 +111,7 @@ else | ||
| 29 | # deleting the $(srcdir)/cp/cfns.h file. | ||
| 30 | $(srcdir)/cp/cfns.h: | ||
| 31 | endif | ||
| 32 | - gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ | ||
| 33 | + gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ | ||
| 34 | $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h | ||
| 35 | |||
| 36 | # | ||
| 37 | diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf | ||
| 38 | index 05ca753..d9b16b8 100644 | ||
| 39 | --- a/gcc/cp/cfns.gperf | ||
| 40 | +++ b/gcc/cp/cfns.gperf | ||
| 41 | @@ -1,3 +1,5 @@ | ||
| 42 | +%language=C++ | ||
| 43 | +%define class-name libc_name | ||
| 44 | %{ | ||
| 45 | /* Copyright (C) 2000-2014 Free Software Foundation, Inc. | ||
| 46 | |||
| 47 | @@ -16,14 +18,6 @@ for more details. | ||
| 48 | You should have received a copy of the GNU General Public License | ||
| 49 | along with GCC; see the file COPYING3. If not see | ||
| 50 | <http://www.gnu.org/licenses/>. */ | ||
| 51 | -#ifdef __GNUC__ | ||
| 52 | -__inline | ||
| 53 | -#endif | ||
| 54 | -static unsigned int hash (const char *, unsigned int); | ||
| 55 | -#ifdef __GNUC__ | ||
| 56 | -__inline | ||
| 57 | -#endif | ||
| 58 | -const char * libc_name_p (const char *, unsigned int); | ||
| 59 | %} | ||
| 60 | %% | ||
| 61 | # The standard C library functions, for feeding to gperf; the result is used | ||
| 62 | diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h | ||
| 63 | index c845ddf..65801d1 100644 | ||
| 64 | --- a/gcc/cp/cfns.h | ||
| 65 | +++ b/gcc/cp/cfns.h | ||
| 66 | @@ -1,5 +1,5 @@ | ||
| 67 | -/* ANSI-C code produced by gperf version 3.0.3 */ | ||
| 68 | -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ | ||
| 69 | +/* C++ code produced by gperf version 3.0.4 */ | ||
| 70 | +/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ | ||
| 71 | |||
| 72 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | ||
| 73 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ | ||
| 74 | @@ -28,7 +28,7 @@ | ||
| 75 | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." | ||
| 76 | #endif | ||
| 77 | |||
| 78 | -#line 1 "cfns.gperf" | ||
| 79 | +#line 3 "cfns.gperf" | ||
| 80 | |||
| 81 | /* Copyright (C) 2000-2014 Free Software Foundation, Inc. | ||
| 82 | |||
| 83 | @@ -47,25 +47,18 @@ for more details. | ||
| 84 | You should have received a copy of the GNU General Public License | ||
| 85 | along with GCC; see the file COPYING3. If not see | ||
| 86 | <http://www.gnu.org/licenses/>. */ | ||
| 87 | -#ifdef __GNUC__ | ||
| 88 | -__inline | ||
| 89 | -#endif | ||
| 90 | -static unsigned int hash (const char *, unsigned int); | ||
| 91 | -#ifdef __GNUC__ | ||
| 92 | -__inline | ||
| 93 | -#endif | ||
| 94 | -const char * libc_name_p (const char *, unsigned int); | ||
| 95 | /* maximum key range = 391, duplicates = 0 */ | ||
| 96 | |||
| 97 | -#ifdef __GNUC__ | ||
| 98 | -__inline | ||
| 99 | -#else | ||
| 100 | -#ifdef __cplusplus | ||
| 101 | -inline | ||
| 102 | -#endif | ||
| 103 | -#endif | ||
| 104 | -static unsigned int | ||
| 105 | -hash (register const char *str, register unsigned int len) | ||
| 106 | +class libc_name | ||
| 107 | +{ | ||
| 108 | +private: | ||
| 109 | + static inline unsigned int hash (const char *str, unsigned int len); | ||
| 110 | +public: | ||
| 111 | + static const char *libc_name_p (const char *str, unsigned int len); | ||
| 112 | +}; | ||
| 113 | + | ||
| 114 | +inline unsigned int | ||
| 115 | +libc_name::hash (register const char *str, register unsigned int len) | ||
| 116 | { | ||
| 117 | static const unsigned short asso_values[] = | ||
| 118 | { | ||
| 119 | @@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len) | ||
| 120 | return hval + asso_values[(unsigned char)str[len - 1]]; | ||
| 121 | } | ||
| 122 | |||
| 123 | -#ifdef __GNUC__ | ||
| 124 | -__inline | ||
| 125 | -#ifdef __GNUC_STDC_INLINE__ | ||
| 126 | -__attribute__ ((__gnu_inline__)) | ||
| 127 | -#endif | ||
| 128 | -#endif | ||
| 129 | const char * | ||
| 130 | -libc_name_p (register const char *str, register unsigned int len) | ||
| 131 | +libc_name::libc_name_p (register const char *str, register unsigned int len) | ||
| 132 | { | ||
| 133 | enum | ||
| 134 | { | ||
| 135 | diff --git a/gcc/cp/except.c b/gcc/cp/except.c | ||
| 136 | index 221971a..32340f5 100644 | ||
| 137 | --- a/gcc/cp/except.c | ||
| 138 | +++ b/gcc/cp/except.c | ||
| 139 | @@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn) | ||
| 140 | unless the system headers are playing rename tricks, and if | ||
| 141 | they are, we don't want to be confused by them. */ | ||
| 142 | id = DECL_NAME (fn); | ||
| 143 | - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); | ||
| 144 | + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), | ||
| 145 | + IDENTIFIER_LENGTH (id)); | ||
| 146 | } | ||
| 147 | |||
| 148 | /* Returns nonzero if an exception of type FROM will be caught by a | ||
| 149 | -- | ||
| 150 | 2.8.2 | ||
| 151 | |||
