Opened 10 years ago

Closed 8 years ago

#45675 closed defect (fixed)

cryptlib @3.4.2 fails to build on 10.10 with XCode 6.1

Reported by: JeNeSuisPasDave (Dave Hein) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.3.2
Keywords: Cc: jmroot (Joshua Root), swenska@…
Port: cryptlib

Description (last modified by larryv (Lawrence Velázquez))

Getting errors like this:

:info:build bn/bn_asm.c:734:2: error: integer constant is larger than the largest unsigned integer type
:info:build         sqr_add_c2(a,1,0,c2,c3,c1);
:info:build         ^

And lots of warnings like this:

info:build bn/bn_asm.cbn/bn_asm.c::8888::33::  warning: warning: shift count >= width of type [-Wshift-count-overflow]
:info:build                 mul_add(rp[0],ap[0],w,c1);
:info:build                 ^~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ./bn/bn_lcl.hshift count >= width of type [-Wshift-count-overflow]
:info:build                 mul_add(rp[0],ap[0],w,c1);
:info:build                 ^~~~~~~~~~~~~~~~~~~~~~~~~
:info:build ./bn/bn_lcl.h:315:7: note: expanded from macro 'mul_add'
:info:build         (c)= Hw(t); \
:info:build              ^~~~~
:info:build ./bn/bn_lcl.h:296:34: note: expanded from macro 'Hw'
:info:build #define Hw(t)    (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2)
:info:build                                  ^ ~~~~~~~~

Full log is attached.

Attachments (2)

main.log (132.9 KB) - added by JeNeSuisPasDave (Dave Hein) 10 years ago.
build log
bn_bn.h.diff (422 bytes) - added by jmroot (Joshua Root) 9 years ago.
possible workaround

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by JeNeSuisPasDave (Dave Hein)

Attachment: main.log added

build log

comment:1 Changed 10 years ago by JeNeSuisPasDave (Dave Hein)

Drat. port in ticket metadata should be 'cryptlib'. Weird that I can't fix that after submission. :-(

comment:2 Changed 10 years ago by JeNeSuisPasDave (Dave Hein)

Cc: dhein@… added

Cc Me!

comment:3 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: dhein@… removed
Description: modified (diff)
Port: cryptlib added
Summary: Crypt lib fails to build on 10.10 with XCode 6.1cryptlib fails to build on 10.10 with XCode 6.1

comment:4 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Summary: cryptlib fails to build on 10.10 with XCode 6.1cryptlib @3.4.2 fails to build on 10.10 with XCode 6.1

The latest beta, 3.4.3 beta, still has this problem. I reported this problem to the cryptlib mailing list.

comment:5 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jmr@… added; ryandesign@… removed
Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

I have finally realized that this problem goes away if I remove a patch we have been using:

browser:trunk/dports/devel/cryptlib/files/patch-crypt-osconfig.h.diff@114713

This patch has been there for 6 years, since r58077 ("update to 3.3.3 and fix a bunch of stuff (#21536)"). It adds these lines on OS X:

  #if defined( __LP64__ )
	#undef SIXTY_FOUR_BIT
	#define SIXTY_FOUR_BIT_LONG
  #endif

This seems reasonable, since there is an earlier part of the file that does the same thing on 64-bit *BSD and Linux systems, but apparently it causes a problem now.

comment:6 Changed 10 years ago by jmroot (Joshua Root)

I would certainly not assume that that patch is correct for versions other than 3.3.3.

comment:7 Changed 10 years ago by jmroot (Joshua Root)

The compiler is right though, bn/bn.h says #define BN_MASK (0xffffffffffffffffffffffffffffffffLL) which is a 128-bit constant.

comment:8 Changed 10 years ago by jmroot (Joshua Root)

128-bit numbers are really hard to work with, especially when avoiding nonstandard extensions. See what printf says when you try to give it one, for example. I confirmed the construct in the attached patch compares as greater than 0xffffffffffffffff at least.

comment:9 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: swenska@… added

Has duplicate #48162. I'm waiting for the developers of cryptlib to release version 3.4.3 which should fix this.

Changed 9 years ago by jmroot (Joshua Root)

Attachment: bn_bn.h.diff added

possible workaround

comment:10 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Resolved by updating to 3.4.3 in r153798.

Note: See TracTickets for help on using tickets.