[vlc-devel] [PATCH] gmp: fix compilation on mipsel
Edward Wang
edward.c.wang at compdigitec.com
Tue Aug 13 15:51:19 CEST 2013
GCC 4.4+ no longer accepts the "=h" constraint.
---
contrib/src/gmp/mips.diff | 23 +++++++++++++++++++++++
contrib/src/gmp/rules.mak | 1 +
2 files changed, 24 insertions(+)
create mode 100644 contrib/src/gmp/mips.diff
diff --git a/contrib/src/gmp/mips.diff b/contrib/src/gmp/mips.diff
new file mode 100644
index 0000000..1d85b78
--- /dev/null
+++ b/contrib/src/gmp/mips.diff
@@ -0,0 +1,23 @@
+--- gmp/longlong.h 2006-03-14 10:57:54.000000000 -0500
++++ gmp/longlong.h 2013-08-12 12:03:50.080931954 -0400
+@@ -1011,7 +1011,19 @@
+ #endif /* __m88000__ */
+
+ #if defined (__mips) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++
++#define GCC_VERSION (__GNUC__ * 10000 \
++ + __GNUC_MINOR__ * 100 \
++ + __GNUC_PATCHLEVEL__)
++
++#if GCC_VERSION >= 40400
++#define umul_ppmm(w1, w0, u, v) \
++ do { \
++ uint64_t res = u*v; \
++ w1 = res >> 32; \
++ w0 = res; \
++ } while(0);
++#elif GCC_VERSION >= 20700
+ #define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+ #else
diff --git a/contrib/src/gmp/rules.mak b/contrib/src/gmp/rules.mak
index 63c4dfd..1b793cf 100644
--- a/contrib/src/gmp/rules.mak
+++ b/contrib/src/gmp/rules.mak
@@ -15,6 +15,7 @@ gmp: gmp-$(GMP_VERSION).tar.bz2 .sum-gmp
$(UNPACK)
$(APPLY) $(SRC)/gmp/inline.diff
$(APPLY) $(SRC)/gmp/arm.diff
+ $(APPLY) $(SRC)/gmp/mips.diff
$(APPLY) $(SRC)/gmp/ansitest.diff
$(APPLY) $(SRC)/gmp/ansi2knr.diff
$(MOVE)
--
1.8.4.rc1
More information about the vlc-devel
mailing list