On Thu, Apr 21, 2011 at 06:50:31PM +0200, Aurelien Jarno wrote:
> Package: libzn-poly
> Version: 0.8-1
> Severity: serious
> 
> Since GCC 4.4 it's not possible anymore to use the 'h' constraints for
> MIPS inline assembly code when doing a multiplication. That's why
> libzn-poly fails to build from source on mips and mipsel.
> 
> That said GCC supports 32x32 => 64 multiplication on 32-bit architectures
> for a lot of time, so there is no need to use assembly code for that. 
> The patch below fixes the problem by using standard multiplication 
> instead of assembly code. I have also included the code for MIPS64 using
> 128-bit hints for reference, though it is not used in Debian.
> 

I have just done an NMU to fix this issue, and uploaded it in DELAYED/4.
Please find the diff below (similar to the patch I sent a few weeks
ago).

diff -u libzn-poly-0.8/debian/changelog libzn-poly-0.8/debian/changelog
--- libzn-poly-0.8/debian/changelog
+++ libzn-poly-0.8/debian/changelog
@@ -1,3 +1,11 @@
+libzn-poly (0.8-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix gcc-4.5 FTBFS on mips, due to old assembly constraints usage
+    (Closes: #623598).
+
+ -- Aurelien Jarno <aure...@debian.org>  Mon, 9 May 2011 20:57:23 +0200
+
 libzn-poly (0.8-1) unstable; urgency=low
 
   * Initial release (Closes: #480094).
diff -u libzn-poly-0.8/debian/patches/series 
libzn-poly-0.8/debian/patches/series
--- libzn-poly-0.8/debian/patches/series
+++ libzn-poly-0.8/debian/patches/series
@@ -1,0 +2 @@
+gcc-4.5-mips.patch
--- libzn-poly-0.8.orig/debian/patches/gcc-4.5-mips.patch
+++ libzn-poly-0.8/debian/patches/gcc-4.5-mips.patch
@@ -0,0 +1,40 @@
+Since GCC 4.4 it's not possible anymore to use the 'h' constraints for
+MIPS inline assembly code when doing a multiplication. That's why
+libzn-poly fails to build from source on mips and mipsel.
+
+That said GCC supports 32x32 => 64 multiplication on 32-bit architectures
+for a lot of time, so there is no need to use assembly code for that. 
+The patch below fixes the problem by using standard multiplication 
+instead of assembly code. I have also included the code for MIPS64 using
+128-bit hints for reference, though it is not used in Debian.
+
+--- libzn-poly-0.8.orig/wide_arith.h
++++ libzn-poly-0.8/wide_arith.h
+@@ -244,14 +244,23 @@
+ #if (UNSIGNED_LONG_BITS == 32)
+ 
+ #define ZNP_MUL_WIDE(hi, lo, a, b)                                            
\
+-   __asm__ ("multu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
+-
++   do {                                                                       
\
++       uint64_t result;                                                       
\
++       result = (uint64_t) a * b;                                             
\
++       hi = (uint32_t)(result >> 32);                                         
\
++       lo = (uint32_t) result;                                                
\
++   } while (0);
+ 
+ #elif (UNSIGNED_LONG_BITS == 64)
+ 
+ #define ZNP_MUL_WIDE(hi, lo, a, b)                                            
\
+-   __asm__ ("dmultu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
+-
++   do {                                                                       
\
++       typedef unsigned int uint128_t __attribute__((mode(TI)));              
\
++       uint128_t result;                                                      
\
++       result = (uint128_t) a * b;                                            
\
++       hi = (uint64_t)(result >> 64);                                         
\
++       lo = (uint64_t) result;                                                
\
++   } while (0);
+ 
+ #endif
+ 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurel...@aurel32.net                 http://www.aurel32.net



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to