瀏覽代碼

gcc: Add patch that fixes GCC building for MIPS.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
Christian Beier 10 年之前
父節點
當前提交
a95a32ce4c
共有 1 個文件被更改,包括 38 次插入0 次删除
  1. 38
    0
      devel/gcc/patches/003-mpfr-longlong-mips.patch

+ 38
- 0
devel/gcc/patches/003-mpfr-longlong-mips.patch 查看文件

@@ -0,0 +1,38 @@
1
+diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h
2
+--- -a/mpfr-2.4.2/mpfr-longlong.h	2009-11-30 02:43:08.000000000 +0000
3
++++ -b/mpfr-2.4.2/mpfr-longlong.h	2009-12-18 12:04:29.000000000 +0000
4
+@@ -1011,7 +1011,15 @@
5
+ #endif /* __m88000__ */
6
+ 
7
+ #if defined (__mips) && W_TYPE_SIZE == 32
8
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
9
++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
10
++#define umul_ppmm(w1, w0, u, v) \
11
++  do {									\
12
++    UDItype _r;							\
13
++    _r = (UDItype) u * v;						\
14
++    (w1) = _r >> 32;							\
15
++    (w0) = (USItype) _r;						\
16
++  } while (0)
17
++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
18
+ #define umul_ppmm(w1, w0, u, v) \
19
+   __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
20
+ #else
21
+@@ -1024,7 +1032,16 @@
22
+ #endif /* __mips */
23
+ 
24
+ #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
25
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
26
++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
27
++typedef unsigned int UTItype __attribute__ ((mode (TI)));
28
++#define umul_ppmm(w1, w0, u, v) \
29
++  do {									\
30
++    UTItype _r;							\
31
++    _r = (UTItype) u * v;						\
32
++    (w1) = _r >> 64;							\
33
++    (w0) = (UDItype) _r;						\
34
++  } while (0)
35
++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
36
+ #define umul_ppmm(w1, w0, u, v) \
37
+   __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
38
+ #else