Opened 9 years ago

Closed 9 years ago

#20866 closed defect (fixed)

libgcrypt universal install is subtly broken

Reported by: wiml@… Owned by: sfiera@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: gnutls universal Cc: jmroot (Joshua Root)
Port: libgcrypt


Building an i386+x86_64 version of libgcrypt seems to result in a broken libgcrypt. My guess is that either BYTES_PER_MPI_LIMB or SIZEOF_UNSIGNED_LONG is being defined inconsistently between configure and compile.

The result I noticed is that when gnutls is linked against this libgcrypt it fails miserably in 'make check'. The simplest test case is probably gnutls' "mpi" test, which fails because gcry_mpi_scan is broken:

|<9>| MPI: length: 60

You'll notice that the random number isn't very random. Further investigation shows that mpi_read_from_buffer() (an internal libgcrypt function) is being passed a valid random buffer, but is returning an mpi with every other 32 bits omitted, as you see.

Libgcrypt does some screwy stuff in its headers, things like #defining SIZEOF_UNSIGNED_LONG to a constant instead of simply using sizeof(unsigned long), so I guess it's not surprising it doesn't cross-compile properly.

Change History (3)

comment:1 Changed 9 years ago by mf2k (Frank Schima)

Keywords: libgcrypt removed
Owner: changed from macports-tickets@… to sfiera@…
Version: 1.8.0

comment:2 Changed 9 years ago by jmroot (Joshua Root)

Cc: jmr@… added

Does r56608 fix this?

comment:3 Changed 9 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Assuming it's ok now...

Note: See TracTickets for help on using tickets.