[MacPorts] #20866: libgcrypt universal install is subtly broken

MacPorts noreply at macports.org
Fri Aug 28 13:56:14 PDT 2009


#20866: libgcrypt universal install is subtly broken
----------------------------------------+-----------------------------------
 Reporter:  wiml@…                      |       Owner:  macports-tickets@…                   
     Type:  defect                      |      Status:  new                                  
 Priority:  Normal                      |   Milestone:                                       
Component:  ports                       |     Version:  1.8.0                                
 Keywords:  libgcrypt gnutls universal  |        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
 rand:81ef2a9400000000a0f6204e00000000183844c00000000024b2a49a00000000e5c9036d0000000026327e4c000000004d31fc1900000000a92feb98
 }}}

 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.

-- 
Ticket URL: <http://trac.macports.org/ticket/20866>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list