summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/gmp
diff options
context:
space:
mode:
authorJussi Kukkonen <jussi.kukkonen@intel.com>2015-09-23 10:34:56 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-24 17:54:24 +0100
commit6d1447ba2d8b1c76fd1f0d26aee250fb82cbeddd (patch)
tree28ec958accc097066d80676379345f5f01dbcb0c /meta/recipes-support/gmp
parent42dc9024d8e659c64d21dbf8032a6e527b184343 (diff)
downloadpoky-6d1447ba2d8b1c76fd1f0d26aee250fb82cbeddd.tar.gz
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>
Diffstat (limited to 'meta/recipes-support/gmp')
-rw-r--r--meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch36
-rw-r--r--meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch39
-rw-r--r--meta/recipes-support/gmp/gmp_4.2.1.bb2
3 files changed, 37 insertions, 40 deletions
diff --git a/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch b/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
new file mode 100644
index 0000000000..627d71aba9
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
@@ -0,0 +1,36 @@
1From 3cb33502bafd04b8ad4ca3454fab16d5ff313297 Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Tue, 22 Sep 2015 13:16:23 +0300
4Subject: [PATCH] Use __gnu_inline__ attribute
5
6gcc5 uses C11 inline rules. This means the old "extern inline"
7semantics are not available without a special attribute.
8
9See: https://gcc.gnu.org/gcc-5/porting_to.html
10
11Upstream-Status: Inappropriate [Fixed in current versions]
12Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
13---
14 gmp-h.in | 5 ++++-
15 1 file changed, 4 insertions(+), 1 deletion(-)
16
17diff --git a/gmp-h.in b/gmp-h.in
18index eed6fe4..361dd1d 100644
19--- a/gmp-h.in
20+++ b/gmp-h.in
21@@ -419,8 +419,11 @@ typedef __mpq_struct *mpq_ptr;
22 /* gcc has __inline__ in all modes, including strict ansi. Give a prototype
23 for an inline too, so as to correctly specify "dllimport" on windows, in
24 case the function is called rather than inlined. */
25+
26+/* Use __gnu_inline__ attribute: later gcc uses different "extern inline"
27+ behaviour */
28 #ifdef __GNUC__
29-#define __GMP_EXTERN_INLINE extern __inline__
30+#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
31 #define __GMP_INLINE_PROTOTYPES 1
32 #endif
33
34--
352.1.4
36
diff --git a/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch b/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
deleted file mode 100644
index 5decb1cec5..0000000000
--- a/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1This patch was removed in f181c6ce8b3 when gmp 4.2.1 was mistakenly
2dropped.
3
4Upstream is not interested in patches for ancient versions.
5
6Upstream-Status: Inappropriate
7Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
8
9# "extern inline" in traditional gcc means that the function should be
10# inlined wherever it's seen, while in C99, "extern inline" means that i
11# the function should only be inlined where the inline definition is
12# seen while in other places it's not inlined:
13# http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html
14#
15# gmp checks "--std=gnu99" to use C99 convention however it internally
16# defines some "extern inline" functions in gmp.h, which is included
17# by mainly .c files and finally lead a flood of redefinition function
18# errors when linking objects together.
19#
20# So disable C99/ANSI detection to stick to tranditional gcc behavior
21#
22# by Kevin Tian <kevin.tian@intel.com>, 2010-08-13
23#
24# (this patch is licensed under GPLv2+)
25
26diff --git a/configure.in b/configure.in
27index 450cc92..aab0b59 100644
28--- a/configure.in
29+++ b/configure.in
30@@ -1869,9 +1869,7 @@ AC_SUBST(DEFN_LONG_LONG_LIMB)
31
32 # The C compiler and preprocessor, put into ANSI mode if possible.
33 AC_PROG_CC
34-AC_PROG_CC_STDC
35 AC_PROG_CPP
36-GMP_H_ANSI
37
38
39 # The C compiler on the build system, and associated tests.
diff --git a/meta/recipes-support/gmp/gmp_4.2.1.bb b/meta/recipes-support/gmp/gmp_4.2.1.bb
index 928c01a5bb..bfc6a380e6 100644
--- a/meta/recipes-support/gmp/gmp_4.2.1.bb
+++ b/meta/recipes-support/gmp/gmp_4.2.1.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
7 file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \ 7 file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
8 file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34" 8 file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34"
9 9
10SRC_URI += "file://disable-stdc.patch \ 10SRC_URI += "file://Use-__gnu_inline__-attribute.patch \
11 file://gmp_fix_for_automake-1.12.patch \ 11 file://gmp_fix_for_automake-1.12.patch \
12 " 12 "
13 13