gnupg: Fix compilation when using gcc 4.4+
authorKhem Raj <raj.khem@gmail.com>
Sat, 19 Dec 2009 03:03:42 +0000 (19:03 -0800)
committerKhem Raj <raj.khem@gmail.com>
Sat, 19 Dec 2009 03:03:42 +0000 (19:03 -0800)
* 'h' contraint for mips inline asm has been dropped
   starting gcc 4.4 so we need to replace its usage
   with equivalent code.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
recipes/gnupg/gnupg-1.4.2.2/dont_use_mips_h_constraint.patch [new file with mode: 0644]
recipes/gnupg/gnupg_1.4.2.2.bb

diff --git a/recipes/gnupg/gnupg-1.4.2.2/dont_use_mips_h_constraint.patch b/recipes/gnupg/gnupg-1.4.2.2/dont_use_mips_h_constraint.patch
new file mode 100644 (file)
index 0000000..e0212b8
--- /dev/null
@@ -0,0 +1,48 @@
+Avoid using h contraint on mips for gcc >= 4.4 as it has been removed
+on gcc 4.4 onwards
+
+see
+
+http://gcc.gnu.org/gcc-4.4/changes.html
+
+-Khem
+
+Index: gnupg-1.4.2.2/mpi/longlong.h
+===================================================================
+--- gnupg-1.4.2.2.orig/mpi/longlong.h  2009-12-18 16:44:21.334633084 -0800
++++ gnupg-1.4.2.2/mpi/longlong.h       2009-12-18 16:48:29.202212344 -0800
+@@ -711,7 +711,15 @@ extern USItype __udiv_qrnnd ();
+  **************  MIPS  *****************
+  ***************************************/
+ #if defined (__mips__) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
++#define umul_ppmm(w1, w0, u, v) \
++  do {                                                                 \
++    UDItype _r;                                                        \
++    _r = (UDItype) u * v;                                              \
++    (w1) = _r >> 32;                                                   \
++    (w0) = (USItype) _r;                                               \
++  } while (0)
++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("multu %2,%3"                                                \
+          : "=l" ((USItype)(w0)),                                      \
+@@ -736,7 +744,16 @@ extern USItype __udiv_qrnnd ();
+  **************  MIPS/64  **************
+  ***************************************/
+ #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
++typedef unsigned int UTItype __attribute__ ((mode (TI)));
++#define umul_ppmm(w1, w0, u, v) \
++ do {                                                                  \
++    UTItype _r;                                                        \
++    _r = (UTItype) u * v;                                              \
++    (w1) = _r >> 64;                                                   \
++    (w0) = (UDItype) _r;                                               \
++  } while (0)
++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("dmultu %2,%3"                                               \
+          : "=l" ((UDItype)(w0)),                                      \
index 6f63649..7f21a31 100644 (file)
@@ -8,8 +8,10 @@ SRC_URI += "file://15_free_caps.patch;patch=1 \
            file://16_min_privileges.patch;patch=1 \
            file://22_zero_length_mpi_fix.patch;patch=1 \
             file://30_nm_always_check.patch;patch=1 \
-            file://long-long-thumb.patch;patch=1"
+            file://long-long-thumb.patch;patch=1 \
+            file://dont_use_mips_h_constraint.patch;patch=1 \
+          "
 
 S = "${WORKDIR}/gnupg-${PV}"
 
-PR = "r3"
+PR = "r4"