Subject: pkgsrc/security/pgp5 build failure
To: None <tech-pkg@netbsd.org>
From: Paul Goyette <paul@whooppee.com>
List: tech-pkg
Date: 12/26/2001 19:59:02
Making all in lib/pgp/random
cc -O2 -DUNIX=1   -DHAVE_CONFIG_H -DPGPTRUSTMODEL=0 -DDEBUG=1
-DUNFINISHED_CODE_ALLOWED=0      -I../../../. -I../../.././include
-I../include -I.     -c pgpRndPool.c
pgpRndPool.c: In function `pgpRandPoolAddEntropy':
pgpRndPool.c:339: Invalid `asm' statement:
pgpRndPool.c:339: fixed or forbidden register 0 (ax) was spilled for
class AREG.
*** Error code 1

Stop.


Line 339 of pgpRndPool.c is

                        delta <<= 1;

                        frac = randFrac;
>>>>>>>>                UMULH_32(t,delta,frac);
                        if ((frac += t) < t) {
                                        if ((frac += delta) < delta)

Macro UMULH is defined, beginning at line 290 of the same source file, 
as follows:

* Due to the way that the fixed-point numbers are stored, the x*y part is
* the high half of the 32-bit unsigned product of x and y. This can be
* safely underestimated if desired, if a 64-bit product is difficult to
* compute.
*
* The simplest snd safest definition is
* #define UMULH_32(r,a,b) (r) = 0
*/
#ifndef UMULH_32
#if defined(__GNUC__) && defined(__i386__)
/* Inline asm goodies */
#define UMULH_32(r,a,b) __asm__("mull %2" : "=d"(r) : "%a"(a), "mr"(b) : "ax")
#elif HAVE64
#define UMULH_32(r,a,b) ((r) = (word32)((word64)(a) * (b) >> 32))
#else
/* Underestimate the product */
#define UMULH_32(r,a,b) ((r) = ((a) >> 16) * ((b) >> 16))
#endif
#endif /* !UMULH_32 */


----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Network Engineer | BCD7 5301 9513 58A6 0DBC |  paul@whooppee.com   |
|  & World Cruiser | 91EB ADB1 A280 3B79 9221 | pgoyette@juniper.net |
----------------------------------------------------------------------