summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-support/gmp
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-support/gmp')
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb33
9 files changed, 305 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/Use-__gnu_inline__-attribute.patch
new file mode 100644
index 000000000..627d71aba
--- /dev/null
+++ b/import-layers/yocto-poky/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/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
new file mode 100644
index 000000000..6da0be9ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
@@ -0,0 +1,57 @@
+From d50686de0406a88ef9112f5252103f799982e84a Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Thu, 4 Feb 2016 14:00:00 -0800
+Subject: [PATCH] avoid h asm constraint for MIPS
+
+The h asm constrain (to extract the high part of a multiplication
+result) has not been recognised since gcc 4.4:
+
+ https://gcc.gnu.org/gcc-4.4/changes.html
+
+Drop the MIPS umul_ppmm() implementations which rely on "=h" and fall
+back to the older implementations (which use explicit mfhi and mflo
+instructions to move the high and low parts of the multiplication
+result into their destinations).
+
+Upstream-Status: Inappropriate [upstream has a different solution]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ longlong.h | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/longlong.h b/longlong.h
+index b53fbee..0193abb 100644
+--- a/longlong.h
++++ b/longlong.h
+@@ -1011,27 +1011,17 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
+ #endif /* __m88000__ */
+
+ #if defined (__mips) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+-#define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1" \
+ : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+-#endif
+ #define UMUL_TIME 10
+ #define UDIV_TIME 100
+ #endif /* __mips */
+
+ #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+-#define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1" \
+ : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+-#endif
+ #define UMUL_TIME 20
+ #define UDIV_TIME 140
+ #endif /* __mips */
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..63aed05ec
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
@@ -0,0 +1,56 @@
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:2240: error: automatic de-ANSI-fication support has been removed
+| Makefile.am:28: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/02
+
+
+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>
+
+
+Index: gmp-4.2.1/configure.in
+===================================================================
+--- gmp-4.2.1.orig/configure.in
++++ gmp-4.2.1/configure.in
+@@ -67,7 +67,7 @@ dnl
+ dnl Note that there's a copy of these options in the top-level Makefile.am,
+ dnl so update there too if changing anything.
+ dnl
+-AM_INIT_AUTOMAKE([1.8 gnu no-dependencies $(top_builddir)/ansi2knr])
++AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
+ AM_CONFIG_HEADER(config.h:config.in)
+ AM_MAINTAINER_MODE
+
+@@ -2022,9 +2022,6 @@ fi
+ echo " MPN_PATH=\"$path\""
+
+
+-# Automake ansi2knr support.
+-AM_C_PROTOTYPES
+-
+ GMP_PROG_AR
+ GMP_PROG_NM
+
+Index: gmp-4.2.1/Makefile.am
+===================================================================
+--- gmp-4.2.1.orig/Makefile.am
++++ gmp-4.2.1/Makefile.am
+@@ -27,7 +27,7 @@
+ # Makefiles in subdirectories, but here we must omit it so automake gives
+ # the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr".
+ #
+-AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies ansi2knr
++AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies
+
+
+ # Libtool -version-info for libgmp.la and libmp.la. See "Versioning" in the
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
new file mode 100644
index 000000000..325ffe491
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
@@ -0,0 +1,61 @@
+From d3b9fc523fc11260ced890c35bc5c9e6391c8656 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 14 Dec 2015 14:19:49 +0200
+Subject: [PATCH] Append the user provided flags to the auto-detected ones.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9cedfeb..87caee5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1921,8 +1921,12 @@ cclist=$cclist
+ EOF
+
+
+-test_CFLAGS=${CFLAGS+set}
+-test_CPPFLAGS=${CPPFLAGS+set}
++test_CFLAGS=
++test_CPPFLAGS=
++
++user_CFLAGS=$CFLAGS
++user_CPPFLAGS=$CPPFLAGS
++user_CXXFLAGS=$CXXFLAGS
+
+ for abi in $abilist; do
+ abi_last="$abi"
+@@ -2353,7 +2357,7 @@ AC_SUBST(CCAS)
+ # The C++ compiler, if desired.
+ want_cxx=no
+ if test $enable_cxx != no; then
+- test_CXXFLAGS=${CXXFLAGS+set}
++ test_CXXFLAGS=
+ AC_PROG_CXX
+
+ echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
+@@ -2381,7 +2385,7 @@ if test $enable_cxx != no; then
+ # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
+ #
+ for cxxflags_choice in $cxxflags_list; do
+- eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
++ eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
+ GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
+ [want_cxx=yes
+ break])
+@@ -2477,6 +2481,8 @@ if test "$enable_assembly" = "no"; then
+ # done
+ fi
+
++CFLAGS="$CFLAGS $user_CFLAGS"
++CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
+
+ cat >&AC_FD_CC <<EOF
+ Decided:
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch
new file mode 100644
index 000000000..564d12d42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/amd64.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Index: gmp-5.0.3/longlong.h
+===================================================================
+--- gmp-5.0.3.orig/longlong.h
++++ gmp-5.0.3/longlong.h
+@@ -994,8 +994,10 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
+ count is only an int. */
+ #define count_trailing_zeros(count, x) \
+ do { \
++ UDItype __cbtmp; \
+ ASSERT ((x) != 0); \
+- __asm__ ("bsfq %1,%q0" : "=r" (count) : "rm" ((UDItype)(x))); \
++ __asm__ ("bsfq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x))); \
++ (count) = __cbtmp; \
+ } while (0)
+ #endif /* x86_64 */
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch
new file mode 100644
index 000000000..74904a253
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp-6.1.0/use-includedir.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: gmp-4.2.4/Makefile.am
+===================================================================
+--- gmp-4.2.4.orig/Makefile.am 2008-09-10 19:31:27.000000000 +0000
++++ gmp-4.2.4/Makefile.am 2009-07-06 20:19:19.000000000 +0000
+@@ -106,7 +106,7 @@
+ # but anyone knowledgable enough to be playing with exec_prefix will be able
+ # to address that.
+ #
+-includeexecdir = $(exec_prefix)/include
++includeexecdir = $(includedir)
+ include_HEADERS = $(GMPXX_HEADERS_OPTION)
+ nodist_includeexec_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION)
+ lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION)
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc
new file mode 100644
index 000000000..abac8cf33
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp.inc
@@ -0,0 +1,12 @@
+SUMMARY = "GNU multiprecision arithmetic library"
+DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers"
+HOMEPAGE = "http://gmplib.org/"
+SECTION = "devel"
+
+inherit autotools texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[readline] = "--with-readline=yes,--with-readline=no,readline"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb
new file mode 100644
index 000000000..5e8ee29f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_4.2.1.bb
@@ -0,0 +1,17 @@
+require gmp.inc
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
+ file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
+ file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34"
+
+SRC_URI = "https://gmplib.org/download/${BPN}/archive/${BP}.tar.bz2 \
+ file://Use-__gnu_inline__-attribute.patch \
+ file://gmp_fix_for_automake-1.12.patch \
+ file://avoid-h-asm-constraint-for-MIPS.patch \
+"
+
+SRC_URI[md5sum] = "091c56e0e1cca6b09b17b69d47ef18e3"
+SRC_URI[sha256sum] = "d07ffcb37eecec35c5ec72516d10b35fdf6e6fef1fcf1dcd37e30b8cbf8bf941"
diff --git a/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb
new file mode 100644
index 000000000..de827f5b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-support/gmp/gmp_6.1.0.bb
@@ -0,0 +1,33 @@
+require gmp.inc
+
+LICENSE = "GPLv2+ | LGPLv3+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+"
+
+REVISION = ""
+SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2 \
+ file://amd64.patch \
+ file://use-includedir.patch \
+ file://0001-Append-the-user-provided-flags-to-the-auto-detected-.patch \
+ "
+
+SRC_URI[md5sum] = "86ee6e54ebfc4a90b643a65e402c4048"
+SRC_URI[sha256sum] = "498449a994efeba527885c10405993427995d3f86b8768d8cdf8d9dd7c6b73e8"
+
+acpaths = ""
+
+EXTRA_OECONF += " --enable-cxx=detect"
+
+PACKAGES =+ "libgmpxx"
+FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
+
+do_install_append_class-target() {
+ sed -i "s|--sysroot=${STAGING_DIR_HOST}||g" ${D}${includedir}/gmp.h
+}
+
+SSTATE_SCAN_FILES += "gmp.h"
+
+BBCLASSEXTEND = "native nativesdk"
OpenPOWER on IntegriCloud