[vlc-commits] gmp: fix compilation on mipsel

Edward Wang git at videolan.org
Thu Aug 15 12:11:04 CEST 2013


vlc | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Tue Aug 13 09:51:19 2013 -0400| [38a57f60a5f2353cc2d3b0e552691c0716406c34] | committer: Jean-Baptiste Kempf

gmp: fix compilation on mipsel

GCC 4.4+ no longer accepts the "=h" constraint.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38a57f60a5f2353cc2d3b0e552691c0716406c34
---

 contrib/src/gmp/mips.diff |   23 +++++++++++++++++++++++
 contrib/src/gmp/rules.mak |    1 +
 2 files changed, 24 insertions(+)

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)



More information about the vlc-commits mailing list