On Sun, Apr 17, 2011 at 11:41:31PM +0200, Aurelien Jarno wrote:
> Package: ntl
> Version: 5.4.2-4
> 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 sprng
> fails to build from source on mips and mipsel.
> 
> That said GCC supports 32x32 => 64 multiplication on 32-bit architecture
> 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 (the second hunk), 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 ntl-5.4.2/debian/changelog ntl-5.4.2/debian/changelog
--- ntl-5.4.2/debian/changelog
+++ ntl-5.4.2/debian/changelog
@@ -1,3 +1,11 @@
+ntl (5.4.2-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix gcc-4.5 FTBFS on mips, due to old assembly constraints usage
+    (Closes: #623162).
+
+ -- Aurelien Jarno <aure...@debian.org>  Mon, 09 May 2011 20:41:04 +0200
+
 ntl (5.4.2-4) unstable; urgency=low
 
   * Fix a missing cstdio include that slipped by (Closes: #505142).
diff -u ntl-5.4.2/debian/patches/series ntl-5.4.2/debian/patches/series
--- ntl-5.4.2/debian/patches/series
+++ ntl-5.4.2/debian/patches/series
@@ -5,0 +6 @@
+gcc-4.5-mips.patch
--- ntl-5.4.2.orig/debian/patches/gcc-4.5-mips.patch
+++ ntl-5.4.2/debian/patches/gcc-4.5-mips.patch
@@ -0,0 +1,37 @@
+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 sprng
+fails to build from source on mips and mipsel.
+
+That said GCC supports 32x32 => 64 multiplication on 32-bit architecture
+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 (the second hunk), though it is not used in
+Debian.
+
+--- ntl-5.4.2.orig/include/NTL/SPMM_ASM.h
++++ ntl-5.4.2/include/NTL/SPMM_ASM.h
+@@ -147,8 +147,8 @@
+ 
+ static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
+ {
+-   unsigned long hi, lo;
+-   __asm__ ("multu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
++   unsigned long hi;
++   hi = ((unsigned long long) a * b) >> 32;
+    return hi;
+ } 
+ 
+@@ -159,8 +159,9 @@
+ 
+ static inline unsigned long MulHiUL(unsigned long a, unsigned long b)
+ {
+-   unsigned long hi, lo;
+-   __asm__ ("dmultu %2,%3" : "=l" (lo), "=h" (hi) : "d" (a), "d" (b));
++   typedef unsigned int uint128_t __attribute__((mode(TI)));
++   unsigned long hi;
++   hi = ((uint128_t) a * b) >> 64;
+    return hi;
+ }
+ 
+
-- 
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