Subject: Re: gnupg 1.0.1?
To: None <port-arm32@netbsd.org>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 07/10/2000 13:31:05
This is a multipart MIME message.

--==_Exmh_6398309760
Content-Type: text/plain; charset=us-ascii

> On Mon, Jul 10, 2000 at 06:42:33AM +0200, Jan-Uwe Finck wrote:
> > On Sun, Jul 09, 2000 at 05:48:48PM +0200, Frank Wennmohs wrote:
> > > I asked this once (ages ago...), but I would like to know
> > > if anyone got this gnupg1.0.1 working on arm32.
> > > (especially the key-generation)
> It's best to send a problem report if you want to get it fixed.
> (send-pr(1) or http://www.netbsd.org/Misc/send-pr.html )
> 
> > No, compilation and installation seem to work fine, but not the
> > key-generation. It just generates and generates and..
> > This is on a RiscPC 600 with an ARM610 with pkgsrc from yesterday.
> I bet it's a compiler/optimization bug. I've seen something similar with
> ssh's (or was it pgp's?) key generation some months/years ago.
> 
> Workaround: Compile the key-generator (or the whole package) with a lower
> optimization (-O) or no optimization at all - often this helps.

But it doesn't help find the real problem. 

In this case it is that the version of longlong.h included in this package 
is old and buggy.

Please try this patch to mpi/longlong.h:



--==_Exmh_6398309760
Content-Type: application/x-patch ; name="ll.h.patch"
Content-Description: ll.h.patch
Content-Disposition: attachment; filename="ll.h.patch"

--- longlong.h.orig	Mon Jul 10 13:27:11 2000
+++ longlong.h	Mon Jul 10 13:27:28 2000
@@ -200,24 +200,25 @@
 	     "r" ((USItype)(al)),                                       \
 	     "rI" ((USItype)(bl)))
 #define umul_ppmm(xh, xl, a, b) \
-  __asm__ ("%@ Inlined umul_ppmm
-	mov	%|r0, %2, lsr #16
-	mov	%|r2, %3, lsr #16
-	bic	%|r1, %2, %|r0, lsl #16
-	bic	%|r2, %3, %|r2, lsl #16
-	mul	%1, %|r1, %|r2
-	mul	%|r2, %|r0, %|r2
-	mul	%|r1, %0, %|r1
-	mul	%0, %|r0, %0
-	adds	%|r1, %|r2, %|r1
-	addcs	%0, %0, #65536
-	adds	%1, %1, %|r1, lsl #16
-	adc	%0, %0, %|r1, lsr #16"                                  \
-	   : "=&r" ((USItype)(xh)),                                     \
-	     "=r" ((USItype)(xl))                                       \
-	   : "r" ((USItype)(a)),                                        \
-	     "r" ((USItype)(b))                                         \
-	   : "r0", "r1", "r2")
+{register USItype __t0, __t1, __t2;					\
+  __asm__ ("%@ Inlined umul_ppmm\n"					\
+	   "	mov	%2, %5, lsr #16\n"				\
+	   "	mov	%0, %6, lsr #16\n"				\
+	   "	bic	%3, %5, %2, lsl #16\n"				\
+	   "	bic	%4, %6, %0, lsl #16\n"				\
+	   "	mul	%1, %3, %4\n"					\
+	   "	mul	%4, %2, %4\n"					\
+	   "	mul	%3, %0, %3\n"					\
+	   "	mul	%0, %2, %0\n"					\
+	   "	adds	%3, %4, %3\n"					\
+	   "	addcs	%0, %0, #65536\n"				\
+	   "	adds	%1, %1, %3, lsl #16\n"				\
+	   "	adc	%0, %0, %3, lsr #16"				\
+	   : "=&r" ((USItype) (xh)),					\
+	     "=r" ((USItype) (xl)),					\
+	     "=&r" (__t0), "=&r" (__t1), "=r" (__t2)			\
+	   : "r" ((USItype) (a)),					\
+	     "r" ((USItype) (b)));}
 #define UMUL_TIME 20
 #define UDIV_TIME 100
 #endif /* __arm__ */

--==_Exmh_6398309760--