Re: cryptlib 3.4.2 / 3.4.3 beta build failure on OS X: integer constant is larger than the largest unsigned integer type

Ryan Schmidt <[email protected]> Sat, 13 Dec 2014 19:26:30 -0600
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
On Dec 13, 2014, at 7:00 PM, Jeffrey Walton wrote:
> On Sat, Dec 13, 2014 at 7:32 PM, Ryan Schmidt wrote:
>> cryptlib 3.4.2 and 3.4.3 beta do not compile on OS X. The error is: "integer constant is larger than the largest unsigned integer type"
>> 
>> Here is the MacPorts project's bug report about this, which includes a full build log:
>> 
>> https://trac.macports.org/ticket/45675
>> ...
> I believe cryptlib uses OpenSSL's big numbers. Out of morbid
> curiosity, does OpenSSL have the same problem?

You're asking does openssl fail to build? No, it builds fine.

cryptlib used to build fine on OS X, but this failure started after some recent change (either the update to OS X 10.10 or the update to Xcode 6 or 6.1).


> For OpenSSL's target of darwin64-x86_64-cc, configure defines
> SIXTY_FOUR_BIT_LONG.
> 
> You might also be able to clean it up by defining THIRTY_TWO_BIT:
> 
> $ cd crypto/bn/
> $ grep -R SIXTY_FOUR_BIT_LONG *
> bn.h:#ifdef SIXTY_FOUR_BIT_LONG
> bn_div.c:#  elif defined(__x86_64) && defined(SIXTY_FOUR_BIT_LONG)
> bn_gf2m.c:#if defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
> bn_gf2m.c:#if defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)
> bn_lcl.h:# if defined(__alpha) && (defined(SIXTY_FOUR_BIT_LONG) ||
> defined(SIXTY_FOUR_BIT))
> bn_lcl.h:# elif defined(_ARCH_PPC) && defined(__64BIT__) &&
> defined(SIXTY_FOUR_BIT_LONG)
> bn_lcl.h:       (defined(SIXTY_FOUR_BIT_LONG) || defined(SIXTY_FOUR_BIT))
> bn_lcl.h:# elif defined(__mips) && (defined(SIXTY_FOUR_BIT) ||
> defined(SIXTY_FOUR_BIT_LONG))
> bn_lib.c:#if defined(SIXTY_FOUR_BIT_LONG)
> bn_lib.c:#if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) ||
> defined(SIXTY_FOUR_BIT_LONG)
> bn_lib.c:#if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) ||
> defined(SIXTY_FOUR_BIT_LONG)
> 
> If its not an issue that can be cleared by configuring, then you may
> have to wait until OpenSSL cleans up the undefined behavior. (I have
> not gotten any traction with the project in cleaning up low hanging
> fruit like this, and I have been trying for years).

I added -DTHIRTY_TWO_BIT to CFLAGS which resulted in the error:

./crypt/brg_types.h:108:27: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long')

Instead, building cryptlib 3.4.2 for -arch i386 instead of -arch x86_64 does work; thanks. However, building for 64-bit is preferable.



_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.