[gnutls-help] what exactly is gnutls 3.2.13 and 3.3.1 looking for in libgmp ??

dev dev at cor0.com
Tue Apr 29 21:01:31 CEST 2014


configure in 3.2.13 and 3.3.1 both seem broken regarding libgmp.

During configure of both 3.2.13 and 3.3.1 I get the same error
regarding libgmp :

.
.
.
checking for inline... inline
checking for ANSI C header files... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for NETTLE... yes
checking for HOGWEED... yes
checking for __gmpz_cmp in -lgmp... no
configure: error:
***
*** gmp was not found.


However libgmp is just recently built, tested and fully up to date :

$ ls -lap /usr/local/lib/libgmp*
-rw-r--r--   1 dclarke  adbs     3599472 Apr 29 17:36
/usr/local/lib/libgmp.a
-rwxr-xr-x   1 dclarke  adbs         914 Apr 29 17:36
/usr/local/lib/libgmp.la
lrwxrwxrwx   1 dclarke  adbs          16 Apr 29 17:36
/usr/local/lib/libgmp.so -> libgmp.so.10.2.0*
lrwxrwxrwx   1 dclarke  adbs          16 Apr 29 17:36
/usr/local/lib/libgmp.so.10 -> libgmp.so.10.2.0*
-rwxr-xr-x   1 dclarke  other    1445024 Nov 12  2012
/usr/local/lib/libgmp.so.10.0.5
-rwxr-xr-x   1 dclarke  other    1790096 Mar 23  2013
/usr/local/lib/libgmp.so.10.1.1
-rwxr-xr-x   1 dclarke  adbs     1827824 Oct 17  2013
/usr/local/lib/libgmp.so.10.1.3
-rwxr-xr-x   1 dclarke  adbs     1842776 Apr 29 17:36
/usr/local/lib/libgmp.so.10.2.0
-rw-r--r--   1 dclarke  adbs      444456 Apr 29 17:36
/usr/local/lib/libgmpxx.a
-rwxr-xr-x   1 dclarke  adbs         990 Apr 29 17:36
/usr/local/lib/libgmpxx.la
lrwxrwxrwx   1 dclarke  adbs          17 Apr 29 17:36
/usr/local/lib/libgmpxx.so -> libgmpxx.so.4.4.0*
lrwxrwxrwx   1 dclarke  adbs          17 Apr 29 17:36
/usr/local/lib/libgmpxx.so.4 -> libgmpxx.so.4.4.0*
-rwxr-xr-x   1 dclarke  other     203088 Nov 12  2012
/usr/local/lib/libgmpxx.so.4.2.5
-rwxr-xr-x   1 dclarke  other     298280 Mar 23  2013
/usr/local/lib/libgmpxx.so.4.3.1
-rwxr-xr-x   1 dclarke  adbs      347088 Oct 17  2013
/usr/local/lib/libgmpxx.so.4.3.3
-rwxr-xr-x   1 dclarke  adbs      347272 Apr 29 17:36
/usr/local/lib/libgmpxx.so.4.4.0


So what exactly is this double underscore test for __gmpz_cmp about ?

Here is what config.log has to say :

configure:8421: checking for __gmpz_cmp in -lgmp
configure:8446: /opt/solarisstudio12.3/bin/cc -o conftest -errfmt=error
-erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s
-xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs
-ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1
-xtarget=ultraT2 -xcache=8/16/4:4096/64/16 -I/usr/local/include
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE  conftest.c
-lgmp   >&5
"conftest.c", line 44: warning: statement not reached
ld: fatal: library -lgmp: not found
ld: fatal: file processing errors. No output written to conftest
configure:8446: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GnuTLS"
| #define PACKAGE_TARNAME "gnutls"
| #define PACKAGE_VERSION "3.3.1"
| #define PACKAGE_STRING "GnuTLS 3.3.1"
| #define PACKAGE_BUGREPORT "bugs at gnutls.org"
| #define PACKAGE_URL ""
| #define PACKAGE "gnutls"
| #define VERSION "3.3.1"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _DARWIN_C_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define HAVE_FSEEKO 1
| #define _DARWIN_USE_64_BIT_INODE 1
| #define STDC_HEADERS 1
| #define HAVE_LIBNETTLE 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char __gmpz_cmp ();
| int
| main ()
| {
| return __gmpz_cmp ();
|   ;
|   return 0;
| }
configure:8455: result: no
configure:8460: error:
***
*** gmp was not found.


I don't see the problem.

Here is foo.c :

$ cat foo.c
char __gmpz_cmp ();
int main () {
 return __gmpz_cmp ();
 return 0;
}


compiles and links fine :

$
$ cc $CFLAGS -H -c -o foo.o foo.c
"foo.c", line 4: warning: statement not reached
$ cc -R/usr/local/lib -L/usr/local/lib $CFLAGS -H -o foo foo.o -lgmp

$ file foo
foo: ELF 64-bit MSB executable, SPARC V9, total store ordering, version
1, dynamically linked (uses shared libs), not stripped

$ ldd foo
        libgmp.so.10 =>  /usr/local/lib/libgmp.so.10
        libc.so.1 =>     /lib/64/libc.so.1
        libgcc_s.so.1 =>
        /usr/local/gcc4/lib/sparcv9/libgcc_s.so.1
        libm.so.2 =>     /lib/64/libm.so.2
        /platform/SUNW,T5240/lib/sparcv9/libc_psr.so.1

$ elfdump -devl foo

ELF Header
  ei_magic:   { 0x7f, E, L, F }
  ei_class:   ELFCLASS64          ei_data:       ELFDATA2MSB
  ei_osabi:   ELFOSABI_SOLARIS    ei_abiversion: EAV_SUNW_CURRENT
  e_machine:  EM_SPARCV9          e_version:     EV_CURRENT
  e_type:     ET_EXEC
  e_flags:    [ EF_SPARCV9_TSO EF_SPARC_SUN_US1 EF_SPARC_SUN_US3 ]
  e_entry:           0x100000840  e_ehsize:     64  e_shstrndx:  25
  e_shoff:                0x19f0  e_shentsize:  64  e_shnum:     26
  e_phoff:                  0x40  e_phentsize:  56  e_phnum:     5

Version Needed Section:  .SUNW_version
     index  file                        version
       [2]  libc.so.1                   SUNW_0.7

Dynamic Section:  .dynamic
     index  tag                value
       [0]  NEEDED            0xde                libgmp.so.10
       [1]  NEEDED            0xcb                libc.so.1
       [2]  INIT              0x1000009d8
       [3]  FINI              0x1000009e8
       [4]  RUNPATH           0xeb
               /usr/local/lib/$ISALIST:/usr/local/lib:/usr/local/lib
       [5]  RPATH             0xeb
               /usr/local/lib/$ISALIST:/usr/local/lib:/usr/local/lib
       [6]  HASH              0x100000178
       [7]  STRTAB            0x100000460
       [8]  STRSZ             0x321
       [9]  SYMTAB            0x100000238
      [10]  SYMENT            0x18
      [11]  CHECKSUM          0xf08c
      [12]  VERNEED           0x100000788
      [13]  VERNEEDNUM        0x1
      [14]  PLTRELSZ          0x60
      [15]  PLTREL            0x7
      [16]  JMPREL            0x1000007d8
      [17]  RELA              0x1000007d8
      [18]  RELASZ            0x60
      [19]  RELAENT           0x18
      [20]  DEBUG             0
      [21]  FLAGS             0                   0
      [22]  FLAGS_1           0                   0
      [23]  SUNW_STRPAD       0x200
      [24]  SUNW_LDMACH       0x2b                EM_SPARCV9
      [25]  PLTGOT            0x100100b00
   [26-36]  NULL              0
$


So what exactly is the configure test looking for here ?

Really it looks like LD_OPTIONS and LD_RUN_PATH are being ignored :

$ echo $LD_OPTIONS
-64 -R/usr/local/lib/$ISALIST:/usr/local/lib
-L/usr/local/lib/$ISALIST:/usr/local/lib

$ echo $LD_RUN_PATH
/usr/local/lib


Unless configure depends on the ill used LD_LIBRARY_PATH value ?


Dennis



More information about the Gnutls-help mailing list