Hi

When building with GCC 4.7, attempting to compile pngshim.c results in an
internal compiler error. The attached patch fixes compiling FreeType for
RISC OS, and this mailing list post (
https://lists.nongnu.org/archive/html/freetype-devel/2017-09/msg00142.html)
shows that the same error occurs when building for MIPS Linux as well.

Regards
Cameron
From b87a179a24114108597b231bfd7304da86254c97 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[email protected]>
Date: Tue, 17 Sep 2019 20:47:39 +0100
Subject: [PATCH] Fix compilation with GCC 4.7

---
 src/sfnt/pngshim.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index ca85d9751..e1e3d7141 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -60,10 +60,11 @@
     /* The `vector_size' attribute was introduced in gcc 3.1, which */
     /* predates clang; the `__BYTE_ORDER__' preprocessor symbol was */
     /* introduced in gcc 4.6 and clang 3.2, respectively.           */
-    /* `__builtin_shuffle' for gcc was introduced in gcc 4.7.0.     */
+    /* `__builtin_shuffle' for gcc was introduced in gcc 4.7.0,     */
+    /* however, this causes an internal compiler error on gcc 4.7.  */
 #if ( ( defined( __GNUC__ )                                &&             \
         ( ( __GNUC__ >= 5 )                              ||               \
-        ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 7 ) ) ) )         ||   \
+        ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 8 ) ) ) )         ||   \
       ( defined( __clang__ )                                       &&     \
         ( ( __clang_major__ >= 4 )                               ||       \
         ( ( __clang_major__ == 3 ) && ( __clang_minor__ >= 2 ) ) ) ) ) && \
-- 
2.11.0

_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to