summaryrefslogtreecommitdiff
path: root/meta/recipes-support/gmp
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2016-02-05 11:56:19 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-07 17:29:45 +0000
commitf8b2eb5eb09a1314ef59e58df95e81c1c1ccf1f4 (patch)
tree8a5bf8df028bc5c0367f6a3e897897a6eb04a8ce /meta/recipes-support/gmp
parente2605d280b515a010c96db6254c24b483727051e (diff)
downloadopenembedded-core-f8b2eb5eb09a1314ef59e58df95e81c1c1ccf1f4.tar.gz
openembedded-core-f8b2eb5eb09a1314ef59e58df95e81c1c1ccf1f4.tar.bz2
openembedded-core-f8b2eb5eb09a1314ef59e58df95e81c1c1ccf1f4.zip
gmp_4.2.1: fix build 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). Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-support/gmp')
-rw-r--r--meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch57
-rw-r--r--meta/recipes-support/gmp/gmp_4.2.1.bb1
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch b/meta/recipes-support/gmp/gmp-4.2.1/avoid-h-asm-constraint-for-MIPS.patch
new file mode 100644
index 0000000000..6da0be9ca0
--- /dev/null
+++ b/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/meta/recipes-support/gmp/gmp_4.2.1.bb b/meta/recipes-support/gmp/gmp_4.2.1.bb
index c25e5ea6ba..5e8ee29f36 100644
--- a/meta/recipes-support/gmp/gmp_4.2.1.bb
+++ b/meta/recipes-support/gmp/gmp_4.2.1.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
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"