mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
gmp: Use __gnu_inline__ attribute in 4.2.1
gcc 5 defaults to C11 rules about "extern inline": this breaks any code that includes gmp.h header from gmp 4.2.1 with 'multiple definition' errors. disable-stdc patch is no longer required because of this. (From OE-Core rev: e03d95d70f8bfe57c258d270ac6b3331650dbc10) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
42dc9024d8
commit
6d1447ba2d
@@ -0,0 +1,36 @@
|
||||
From 3cb33502bafd04b8ad4ca3454fab16d5ff313297 Mon Sep 17 00:00:00 2001
|
||||
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
|
||||
Date: Tue, 22 Sep 2015 13:16:23 +0300
|
||||
Subject: [PATCH] Use __gnu_inline__ attribute
|
||||
|
||||
gcc5 uses C11 inline rules. This means the old "extern inline"
|
||||
semantics are not available without a special attribute.
|
||||
|
||||
See: https://gcc.gnu.org/gcc-5/porting_to.html
|
||||
|
||||
Upstream-Status: Inappropriate [Fixed in current versions]
|
||||
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
|
||||
---
|
||||
gmp-h.in | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gmp-h.in b/gmp-h.in
|
||||
index eed6fe4..361dd1d 100644
|
||||
--- a/gmp-h.in
|
||||
+++ b/gmp-h.in
|
||||
@@ -419,8 +419,11 @@ typedef __mpq_struct *mpq_ptr;
|
||||
/* gcc has __inline__ in all modes, including strict ansi. Give a prototype
|
||||
for an inline too, so as to correctly specify "dllimport" on windows, in
|
||||
case the function is called rather than inlined. */
|
||||
+
|
||||
+/* Use __gnu_inline__ attribute: later gcc uses different "extern inline"
|
||||
+ behaviour */
|
||||
#ifdef __GNUC__
|
||||
-#define __GMP_EXTERN_INLINE extern __inline__
|
||||
+#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
|
||||
#define __GMP_INLINE_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
This patch was removed in f181c6ce8b3 when gmp 4.2.1 was mistakenly
|
||||
dropped.
|
||||
|
||||
Upstream is not interested in patches for ancient versions.
|
||||
|
||||
Upstream-Status: Inappropriate
|
||||
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
|
||||
|
||||
# "extern inline" in traditional gcc means that the function should be
|
||||
# inlined wherever it's seen, while in C99, "extern inline" means that i
|
||||
# the function should only be inlined where the inline definition is
|
||||
# seen while in other places it's not inlined:
|
||||
# http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html
|
||||
#
|
||||
# gmp checks "--std=gnu99" to use C99 convention however it internally
|
||||
# defines some "extern inline" functions in gmp.h, which is included
|
||||
# by mainly .c files and finally lead a flood of redefinition function
|
||||
# errors when linking objects together.
|
||||
#
|
||||
# So disable C99/ANSI detection to stick to tranditional gcc behavior
|
||||
#
|
||||
# by Kevin Tian <kevin.tian@intel.com>, 2010-08-13
|
||||
#
|
||||
# (this patch is licensed under GPLv2+)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 450cc92..aab0b59 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1869,9 +1869,7 @@ AC_SUBST(DEFN_LONG_LONG_LIMB)
|
||||
|
||||
# The C compiler and preprocessor, put into ANSI mode if possible.
|
||||
AC_PROG_CC
|
||||
-AC_PROG_CC_STDC
|
||||
AC_PROG_CPP
|
||||
-GMP_H_ANSI
|
||||
|
||||
|
||||
# The C compiler on the build system, and associated tests.
|
||||
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
|
||||
file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
|
||||
file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34"
|
||||
|
||||
SRC_URI += "file://disable-stdc.patch \
|
||||
SRC_URI += "file://Use-__gnu_inline__-attribute.patch \
|
||||
file://gmp_fix_for_automake-1.12.patch \
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user