From 15a607f307eb52f5389d31b87ecd38010aa4f2d0 Mon Sep 17 00:00:00 2001 From: Philipp Kerling Date: Thu, 16 Mar 2017 18:50:37 +0100 Subject: [PATCH] Fix toolchain gcc compilation with newer host gcc An inline attribute mismatch in the gcc-4.9.2 source causes its compilation to fail on modern gcc versions (verified with gcc 6.3.1, but probably since gcc 5) The patch is courtesy of the gcc-patches mailing list: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html Fixes #2341 --- repos/ports/ports/gcc.hash | 2 +- .../gcc-4.9.2/gnu_inline_mismatch.patch | 33 +++++++++++++++++++ tool/patches/gcc-4.9.2/series | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tool/patches/gcc-4.9.2/gnu_inline_mismatch.patch diff --git a/repos/ports/ports/gcc.hash b/repos/ports/ports/gcc.hash index b107a0dda..ae9cf1c98 100644 --- a/repos/ports/ports/gcc.hash +++ b/repos/ports/ports/gcc.hash @@ -1 +1 @@ -fe976d168f9937cac0ffaa7ec4999d385d076fe2 +6f36711bdcf68dc66357563c8429cd29d8e92003 diff --git a/tool/patches/gcc-4.9.2/gnu_inline_mismatch.patch b/tool/patches/gcc-4.9.2/gnu_inline_mismatch.patch new file mode 100644 index 000000000..2452bdd31 --- /dev/null +++ b/tool/patches/gcc-4.9.2/gnu_inline_mismatch.patch @@ -0,0 +1,33 @@ +Required for building with newer gcc + +See https://gcc.gnu.org/ml/gcc-patches/2015-08/msg00375.html + +-- +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 */ diff --git a/tool/patches/gcc-4.9.2/series b/tool/patches/gcc-4.9.2/series index b23957eb1..e03f45e15 100644 --- a/tool/patches/gcc-4.9.2/series +++ b/tool/patches/gcc-4.9.2/series @@ -10,3 +10,4 @@ libsupcxx_demangle.patch libgcc_s.patch go_libbacktrace.patch target_libbacktrace.patch +gnu_inline_mismatch.patch