* [PATCH 0/1] gmp: Use __gnu_inline__ attribute in 4.2.1 with gcc 5
@ 2015-09-22 11:50 Jussi Kukkonen
2015-09-22 11:50 ` [PATCH 1/1] " Jussi Kukkonen
0 siblings, 1 reply; 3+ messages in thread
From: Jussi Kukkonen @ 2015-09-22 11:50 UTC (permalink / raw)
To: openembedded-core
gmp 4.2.1 doesn't build with gcc5 without a small patch. This didn't
come up in testing because Yoctos "non-gpl3" builder still doesn't
seem to pick up the right version (YOCTO #8158).
The following changes since commit 7b86c771c80d0759c2ca0e57c46c4c966f89c49e:
bitbake: bitbake: bb.fetch2.git: Import errno module (2015-09-19 22:38:44 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib jku/gmp-inline-fix
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=jku/gmp-inline-fix
Jussi Kukkonen (1):
gmp: Use __gnu_inline__ attribute in 4.2.1 with gcc 5
.../Use-gnu-inline-attribute-with-gcc-5.patch | 45 ++++++++++++++++++++++
.../gmp/gmp-4.2.1/disable-stdc.patch | 39 -------------------
meta/recipes-support/gmp/gmp_4.2.1.bb | 2 +-
3 files changed, 46 insertions(+), 40 deletions(-)
create mode 100644 meta/recipes-support/gmp/gmp-4.2.1/Use-gnu-inline-attribute-with-gcc-5.patch
delete mode 100644 meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
--
2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] gmp: Use __gnu_inline__ attribute in 4.2.1 with gcc 5
2015-09-22 11:50 [PATCH 0/1] gmp: Use __gnu_inline__ attribute in 4.2.1 with gcc 5 Jussi Kukkonen
@ 2015-09-22 11:50 ` Jussi Kukkonen
2015-09-23 7:34 ` [PATCH v2 1/1] gmp: Use __gnu_inline__ attribute in 4.2.1 Jussi Kukkonen
0 siblings, 1 reply; 3+ messages in thread
From: Jussi Kukkonen @ 2015-09-22 11:50 UTC (permalink / raw)
To: openembedded-core
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. Backport a fix from 6.0.0.
disable-stdc patch is no longer required because of this.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
.../Use-gnu-inline-attribute-with-gcc-5.patch | 45 ++++++++++++++++++++++
.../gmp/gmp-4.2.1/disable-stdc.patch | 39 -------------------
meta/recipes-support/gmp/gmp_4.2.1.bb | 2 +-
3 files changed, 46 insertions(+), 40 deletions(-)
create mode 100644 meta/recipes-support/gmp/gmp-4.2.1/Use-gnu-inline-attribute-with-gcc-5.patch
delete mode 100644 meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
diff --git a/meta/recipes-support/gmp/gmp-4.2.1/Use-gnu-inline-attribute-with-gcc-5.patch b/meta/recipes-support/gmp/gmp-4.2.1/Use-gnu-inline-attribute-with-gcc-5.patch
new file mode 100644
index 0000000..fe78a0a
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-4.2.1/Use-gnu-inline-attribute-with-gcc-5.patch
@@ -0,0 +1,45 @@
+From 90e87be447c7b9ffe79b10746bafb24e673131a8 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 with gcc 5
+
+gcc5 uses C11 inline rules. This means the old "extern inline"
+semantics are not available without a special attribute.
+
+Upstream-Status: Backport
+See: https://gcc.gnu.org/gcc-5/porting_to.html
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ gmp-h.in | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/gmp-h.in b/gmp-h.in
+index eed6fe4..59521dc 100644
+--- a/gmp-h.in
++++ b/gmp-h.in
+@@ -416,11 +416,18 @@ typedef __mpq_struct *mpq_ptr;
+ inline" would be an acceptable substitute if the compiler (or linker)
+ discards unused statics. */
+
+-/* 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. */
++ /* 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.
++ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
++ inline semantics, unless -fgnu89-inline is used. */
+ #ifdef __GNUC__
++#if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) \
++ || (defined __GNUC_GNU_INLINE__ && defined __cplusplus)
++#define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__))
++#else
+ #define __GMP_EXTERN_INLINE extern __inline__
++#endif
+ #define __GMP_INLINE_PROTOTYPES 1
+ #endif
+
+--
+2.1.4
+
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 5decb1c..0000000
--- a/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
+++ /dev/null
@@ -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.
diff --git a/meta/recipes-support/gmp/gmp_4.2.1.bb b/meta/recipes-support/gmp/gmp_4.2.1.bb
index 928c01a..ea7ace1 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 \
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-with-gcc-5.patch \
file://gmp_fix_for_automake-1.12.patch \
"
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] gmp: Use __gnu_inline__ attribute in 4.2.1
2015-09-22 11:50 ` [PATCH 1/1] " Jussi Kukkonen
@ 2015-09-23 7:34 ` Jussi Kukkonen
0 siblings, 0 replies; 3+ messages in thread
From: Jussi Kukkonen @ 2015-09-23 7:34 UTC (permalink / raw)
To: openembedded-core
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.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
Changes since v1: I was rightly reminded backporting things from
incompatible licenses would be The Most Wrong Thing. This patch
is not quite as complete (as it changes behaviour for all gcc
versions) but it is all my work and should work fine for us.
Thanks/Sorry,
Jussi
.../gmp-4.2.1/Use-__gnu_inline__-attribute.patch | 36 ++++++++++++++++++++
.../gmp/gmp-4.2.1/disable-stdc.patch | 39 ----------------------
meta/recipes-support/gmp/gmp_4.2.1.bb | 2 +-
3 files changed, 37 insertions(+), 40 deletions(-)
create mode 100644 meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
delete mode 100644 meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
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 0000000..627d71a
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
@@ -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
+
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 5decb1c..0000000
--- a/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
+++ /dev/null
@@ -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.
diff --git a/meta/recipes-support/gmp/gmp_4.2.1.bb b/meta/recipes-support/gmp/gmp_4.2.1.bb
index 928c01a..bfc6a38 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 \
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 \
"
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-23 7:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 11:50 [PATCH 0/1] gmp: Use __gnu_inline__ attribute in 4.2.1 with gcc 5 Jussi Kukkonen
2015-09-22 11:50 ` [PATCH 1/1] " Jussi Kukkonen
2015-09-23 7:34 ` [PATCH v2 1/1] gmp: Use __gnu_inline__ attribute in 4.2.1 Jussi Kukkonen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox