Looks like nettle 2.5 should build pretty much out of the box but the Makefiles 
seem to have a few issues. 

After one tosses a ./configure at it we can build just fine up until a lingage 
is requires thus : 

$ ./configure 
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for -R flag... using -R
Searching for libraries
checking /usr/local/lib/lib... not found
checking /usr/local/lib... added
checking /sw/local/lib... not found
checking /sw/lib... not found
checking /usr/gnu/lib... not found
checking /opt/gnu/lib... not found
checking /sw/gnu/lib... not found
checking /usr/freeware/lib... not found
checking /usr/pkg/lib... not found
checking for gcc... /opt/solarisstudio12.3/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
.
.
.
etc etc 
.
.
.

checking for fcntl file locking... yes
checking for __gmpz_getlimbn in -lgmp... no
configure: WARNING: GNU MP not found, or not 3.1 or up, see http://gmplib.org/.
Support for public key algorithms will be unavailable.
checking for __gmpz_powm_sec... no
checking for library containing clock_gettime... -lrt
configure: creating ./config.status
config.status: creating config.make
config.status: creating config.m4
config.status: creating Makefile
config.status: creating tools/Makefile
config.status: creating testsuite/Makefile
config.status: creating examples/Makefile
config.status: creating nettle.pc
config.status: creating hogweed.pc
config.status: creating config.h
config.status: linking sparc64/aes-encrypt-internal.asm to 
aes-encrypt-internal.asm
config.status: linking sparc64/aes-decrypt-internal.asm to 
aes-decrypt-internal.asm
config.status: linking sparc64/arcfour-crypt.asm to arcfour-crypt.asm
config.status: linking sparc64/machine.m4 to machine.m4
config.status: executing nettle-stdint.h commands
config.status: creating nettle-stdint.h : __NETTLE_STDINT_H
configure: summary of build options:

  Version:           nettle 2.5
  Host type:         sparc-sun-solaris2.10
  ABI:               64
  Assembly files:    sparc64
  Install prefix:    /usr/local
  Library directory: ${exec_prefix}/lib/64
  Compiler:          /opt/solarisstudio12.3/bin/cc
  Shared libraries:  yes
  Public key crypto: no


First thing wrong there is that libgmp does exist just fine. 

... anyways .. fire off a gmake and it all looks golden : 

$ gmake 
gmake all-here
gmake[1]: Entering directory `/usr/local/build/nettle-2.5_sparcv9_001'
/opt/solarisstudio12.3/bin/cc -I. -I/usr/local/include:/usr/sfw/include 
-DHAVE_CONFIG_H -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 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -KPIC -Bdynamic  -KPIC 
-Bdynamic -c aesdata.c \
&& true
/opt/solarisstudio12.3/bin/cc -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 
-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE   aesdata.o  -o 
aesdata
/opt/solarisstudio12.3/bin/cc -I. -I/usr/local/include:/usr/sfw/include 
-DHAVE_CONFIG_H -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 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -KPIC -Bdynamic  -KPIC 
-Bdynamic -c desdata.c \
&& true
.
.
.
... and then link goes boom because of the totally missing options to the 
compiler/linker : 

/opt/solarisstudio12.3/bin/cc -I. -I/usr/local/include:/usr/sfw/include 
-DHAVE_CONFIG_H -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 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -KPIC -Bdynamic  -KPIC 
-Bdynamic -c memxor.c -o memxor.po \
&& true
/opt/solarisstudio12.3/bin/cc  -G -h libnettle.so.4 aes-decrypt-internal.po 
aes-decrypt.po aes-encrypt-internal.po aes-encrypt.po aes-encrypt-table.po 
aes-set-encrypt-key.po aes-set-decrypt-key.po aes-meta.po arcfour.po 
arcfour-crypt.po arcfour-meta.po arctwo.po arctwo-meta.po base16-encode.po 
base16-decode.po base16-meta.po base64-encode.po base64-decode.po 
base64-meta.po camellia-crypt.po camellia-crypt-internal.po 
camellia-set-encrypt-key.po camellia-set-decrypt-key.po camellia-table.po 
camellia-meta.po cast128.po cast128-meta.po blowfish.po cbc.po ctr.po gcm.po 
gcm-aes.po des.po des3.po des-compat.po hmac.po hmac-md5.po hmac-ripemd160.po 
hmac-sha1.po hmac-sha224.po hmac-sha256.po hmac-sha384.po hmac-sha512.po 
knuth-lfib.po md2.po md2-meta.po md4.po md4-meta.po md5.po md5-compress.po 
md5-compat.po md5-meta.po ripemd160.po ripemd160-compress.po ripemd160-meta.po 
salsa20-crypt.po salsa20-set-key.po sha1.po sha1-compress.po sha1-meta.po 
sha256.po sha256-compress.po sha224-me
ta.po sha256-meta.po sha512.po sha512-compress.po sha384-meta.po sha512-meta.po 
serpent-set-key.po serpent-encrypt.po serpent-decrypt.po serpent-meta.po 
twofish.po twofish-meta.po yarrow256.po yarrow_key_event.po buffer.po 
buffer-init.po realloc.po nettle-meta-hashes.po nettle-meta-ciphers.po 
nettle-meta-armors.po write-be32.po write-le32.po memxor.po -o libnettle.so 
ld: fatal: file aes-decrypt-internal.po: wrong ELF class: ELFCLASS64
ld: fatal: file processing errors. No output written to libnettle.so
gmake[1]: *** [libnettle.so] Error 2
gmake[1]: Leaving directory `/usr/local/build/nettle-2.5_sparcv9_001'
gmake: *** [all] Error 2
$ 

So let's drop that into a script and kick it off thus : 


$ cat link_hack.sh 
#!/bin/ksh

CFLAGS=\-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\ \-D_TS_ERRNO\ \-D_POSIX_PTHREAD_SEMANTICS\ \
\-D_LARGEFILE64_SOURCE
export CFLAGS

/opt/solarisstudio12.3/bin/cc -\# $CFLAGS -G -h libnettle.so.4 \
aes-decrypt-internal.po \
aes-decrypt.po aes-encrypt-internal.po aes-encrypt.po aes-encrypt-table.po \
aes-set-encrypt-key.po aes-set-decrypt-key.po aes-meta.po arcfour.po \
arcfour-crypt.po arcfour-meta.po arctwo.po arctwo-meta.po base16-encode.po \
base16-decode.po base16-meta.po base64-encode.po base64-decode.po \
base64-meta.po camellia-crypt.po camellia-crypt-internal.po \
camellia-set-encrypt-key.po camellia-set-decrypt-key.po camellia-table.po \
camellia-meta.po cast128.po cast128-meta.po blowfish.po cbc.po ctr.po \
gcm.po gcm-aes.po des.po des3.po des-compat.po hmac.po hmac-md5.po \
hmac-ripemd160.po hmac-sha1.po hmac-sha224.po hmac-sha256.po hmac-sha384.po \
hmac-sha512.po knuth-lfib.po md2.po md2-meta.po md4.po md4-meta.po md5.po \
md5-compress.po md5-compat.po md5-meta.po ripemd160.po ripemd160-compress.po \
ripemd160-meta.po salsa20-crypt.po salsa20-set-key.po sha1.po sha1-compress.po \
sha1-meta.po sha256.po sha256-compress.po sha224-meta.po sha256-meta.po \
sha512.po sha512-compress.po sha384-meta.po sha512-meta.po serpent-set-key.po \
serpent-encrypt.po serpent-decrypt.po serpent-meta.po twofish.po \
twofish-meta.po yarrow256.po yarrow_key_event.po buffer.po buffer-init.po \
realloc.po nettle-meta-hashes.po nettle-meta-ciphers.po nettle-meta-armors.po \
write-be32.po write-le32.po memxor.po \
-o libnettle.so 
$ 

beauty .. links fine now : 

$ 
$ ./link_hack.sh 
### cc: Note: NLSPATH = 
/opt/solarisstudio12.3/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/solarisstudio12.3/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
###     command line files and options (expanded):
### -# -errfmt=error -erroff=%none -errshort=full -xstrconst -m64 -xmemalign=8s 
-xnolibmil -Xa -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none 
-Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xchip=ultraT2 
-xarch=sparcvis2 -xcache=8/16/4:4096/64/16 -D_TS_ERRNO 
-D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -G -hlibnettle.so.4 
aes-decrypt-internal.po aes-decrypt.po aes-encrypt-internal.po aes-encrypt.po 
aes-encrypt-table.po aes-set-encrypt-key.po aes-set-decrypt-key.po aes-meta.po 
arcfour.po arcfour-crypt.po arcfour-meta.po arctwo.po arctwo-meta.po 
base16-encode.po base16-decode.po base16-meta.po base64-encode.po 
base64-decode.po base64-meta.po camellia-crypt.po camellia-crypt-internal.po 
camellia-set-encrypt-key.po camellia-set-decrypt-key.po camellia-table.po 
camellia-meta.po cast128.po cast128-meta.po blowfish.po cbc.po ctr.po gcm.po 
gcm-aes.po des.po des3.po des-compat.po hmac.po hmac-md5.po hmac-ripemd160.po 
hmac-sha1.po hmac-sha224.po hmac-sha256.po 
hmac-sha384.po hmac-sha512.po knuth-lfib.po md2.po md2-meta.po md4.po 
md4-meta.po md5.po md5-compress.po md5-compat.po md5-meta.po ripemd160.po 
ripemd160-compress.po ripemd160-meta.po salsa20-crypt.po salsa20-set-key.po 
sha1.po sha1-compress.po sha1-meta.po sha256.po sha256-compress.po 
sha224-meta.po sha256-meta.po sha512.po sha512-compress.po sha384-meta.po 
sha512-meta.po serpent-set-key.po serpent-encrypt.po serpent-decrypt.po 
serpent-meta.po twofish.po twofish-meta.po yarrow256.po yarrow_key_event.po 
buffer.po buffer-init.po realloc.po nettle-meta-hashes.po 
nettle-meta-ciphers.po nettle-meta-armors.po write-be32.po write-le32.po 
memxor.po -olibnettle.so
### cc: Note: LD_LIBRARY_PATH = (null)
### cc: Note: LD_LIBRARY_PATH_64 = (null)
### cc: Note: LD_RUN_PATH     = /usr/local/lib/$ISALIST:/usr/sfw/lib/$ISALIST
### cc: Note: LD_OPTIONS      = 
-R/usr/local/lib/$ISALIST:/usr/sfw/lib/$ISALIST:/usr/local/lib:/usr/sfw/lib 
-L/usr/local/lib/$ISALIST:/usr/sfw/lib/$ISALIST:/usr/local/lib:/usr/sfw/lib
ln -s /opt/solarisstudio12.3/prod/lib /tmp/lib_link.1351194670.1817.01
/usr/ccs/bin/ld -zld32=-S/tmp/lib_link.1351194670.1817.01/libldstab_ws.so 
-zld64=-S/tmp/lib_link.1351194670.1817.01/v9/libldstab_ws.so 
-zld32=-S/tmp/lib_link.1351194670.1817.01/libld_annotate.so 
-zld64=-S/tmp/lib_link.1351194670.1817.01/v9/libld_annotate.so 
/opt/solarisstudio12.3/prod/lib/v9/crti.o 
/opt/solarisstudio12.3/prod/lib/v9/values-xi.o -hlibnettle.so.4 
aes-decrypt-internal.po aes-decrypt.po aes-encrypt-internal.po aes-encrypt.po 
aes-encrypt-table.po aes-set-encrypt-key.po aes-set-decrypt-key.po aes-meta.po 
arcfour.po arcfour-crypt.po arcfour-meta.po arctwo.po arctwo-meta.po 
base16-encode.po base16-decode.po base16-meta.po base64-encode.po 
base64-decode.po base64-meta.po camellia-crypt.po camellia-crypt-internal.po 
camellia-set-encrypt-key.po camellia-set-decrypt-key.po camellia-table.po 
camellia-meta.po cast128.po cast128-meta.po blowfish.po cbc.po ctr.po gcm.po 
gcm-aes.po des.po des3.po des-compat.po hmac.po hmac-md5.po hmac-ripemd160.po 
hmac-sha1.po hmac-sha224.po
 hmac-sha256.po hmac-sha384.po hmac-sha512.po knuth-lfib.po md2.po md2-meta.po 
md4.po md4-meta.po md5.po md5-compress.po md5-compat.po md5-meta.po 
ripemd160.po ripemd160-compress.po ripemd160-meta.po salsa20-crypt.po 
salsa20-set-key.po sha1.po sha1-compress.po sha1-meta.po sha256.po 
sha256-compress.po sha224-meta.po sha256-meta.po sha512.po sha512-compress.po 
sha384-meta.po sha512-meta.po serpent-set-key.po serpent-encrypt.po 
serpent-decrypt.po serpent-meta.po twofish.po twofish-meta.po yarrow256.po 
yarrow_key_event.po buffer.po buffer-init.po realloc.po nettle-meta-hashes.po 
nettle-meta-ciphers.po nettle-meta-armors.po write-be32.po write-le32.po 
memxor.po -G -o libnettle.so -Y 
"P,/opt/solarisstudio12.3/prod/lib/sparcvis2/64:/opt/solarisstudio12.3/prod/lib/v9:/usr/ccs/lib/sparcv9:/lib/64:/usr/lib/64"
 -Qy /opt/solarisstudio12.3/prod/lib/v9/crtn.o
/usr/ccs/bin/mcs -c libnettle.so
$ 

$ ls -lap libnettle.so
-rwxr-xr-x   1 dclarke  other     590976 Oct 25 19:51 libnettle.so
$ 
$ file libnettle.so
libnettle.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, UltraSPARC3 
Extensions Required, dynamically linked, not stripped
$ elfdump -d libnettle.so

Dynamic Section:  .dynamic
     index  tag                value
       [0]  INIT              0x39f28             
       [1]  FINI              0x39f38             
       [2]  SONAME            0x163d              libnettle.so.4
       [3]  RUNPATH           0x164c              
/usr/local/lib/$ISALIST:/usr/sfw/lib/$ISALIST:/usr/local/lib:/usr/sfw/lib
       [4]  RPATH             0x164c              
/usr/local/lib/$ISALIST:/usr/sfw/lib/$ISALIST:/usr/local/lib:/usr/sfw/lib
       [5]  HASH              0x328               
       [6]  STRTAB            0x23a0              
       [7]  STRSZ             0x1896              
       [8]  SYMTAB            0xb58               
       [9]  SYMENT            0x18                
      [10]  CHECKSUM          0xbcd1              
      [11]  RELACOUNT         0x89                
      [12]  PLTRELSZ          0x690               
      [13]  PLTREL            0x7                 
      [14]  JMPREL            0x5ca8              
      [15]  RELA              0x3c38              
      [16]  RELASZ            0x2700              
      [17]  RELAENT           0x18                
      [18]  REGISTER          0x4e                
      [19]  REGISTER          0x60                
      [20]  FLAGS             0                   0
      [21]  FLAGS_1           0                   0
      [22]  SUNW_STRPAD       0x200               
      [23]  SUNW_LDMACH       0x2b                EM_SPARCV9
      [24]  PLTGOT            0x142f00            
   [25-35]  NULL              0                   
$ 

For some reasons your makefiles seem to forget that this may be a 64-bit sparc 
server and you toss away the $CFLAGS entirely. 

If I try to continue from here .. all is beautiful and we get a nice clean 
build.  Piles of warnings and lots of noise about "incompatible with prototype" 
stuff but certainly compilable and buildable. 

$ find . -type f | xargs file | grep ELF | cut -f1 -d\: | grep -v "\.o$" | sort 
| cat -n -
     1  ./aes-decrypt-internal.po
     2  ./aes-decrypt.po
     3  ./aes-encrypt-internal.po
     4  ./aes-encrypt-table.po
     5  ./aes-encrypt.po
     6  ./aes-meta.po
     7  ./aes-set-decrypt-key.po
     8  ./aes-set-encrypt-key.po
     9  ./aesdata
    10  ./arcfour-crypt.po
    11  ./arcfour-meta.po
    12  ./arcfour.po
    13  ./arctwo-meta.po
    14  ./arctwo.po
    15  ./base16-decode.po
    16  ./base16-encode.po
    17  ./base16-meta.po
    18  ./base64-decode.po
    19  ./base64-encode.po
    20  ./base64-meta.po
    21  ./blowfish.po
    22  ./buffer-init.po
    23  ./buffer.po
    24  ./camellia-crypt-internal.po
    25  ./camellia-crypt.po
    26  ./camellia-meta.po
    27  ./camellia-set-decrypt-key.po
    28  ./camellia-set-encrypt-key.po
    29  ./camellia-table.po
    30  ./cast128-meta.po
    31  ./cast128.po
    32  ./cbc.po
    33  ./ctr.po
    34  ./des-compat.po
    35  ./des.po
    36  ./des3.po
    37  ./desdata
    38  ./examples/base16dec
    39  ./examples/base16enc
    40  ./examples/base64dec
    41  ./examples/base64enc
    42  ./examples/eratosthenes
    43  ./examples/nettle-benchmark
    44  ./examples/next-prime
    45  ./examples/random-prime
    46  ./examples/rsa-decrypt
    47  ./examples/rsa-encrypt
    48  ./examples/rsa-keygen
    49  ./examples/rsa-sign
    50  ./examples/rsa-verify
    51  ./gcm-aes.po
    52  ./gcm.po
    53  ./gcmdata
    54  ./hmac-md5.po
    55  ./hmac-ripemd160.po
    56  ./hmac-sha1.po
    57  ./hmac-sha224.po
    58  ./hmac-sha256.po
    59  ./hmac-sha384.po
    60  ./hmac-sha512.po
    61  ./hmac.po
    62  ./knuth-lfib.po
    63  ./libhogweed.so
    64  ./libnettle.so
    65  ./md2-meta.po
    66  ./md2.po
    67  ./md4-meta.po
    68  ./md4.po
    69  ./md5-compat.po
    70  ./md5-compress.po
    71  ./md5-meta.po
    72  ./md5.po
    73  ./memxor.po
    74  ./nettle-meta-armors.po
    75  ./nettle-meta-ciphers.po
    76  ./nettle-meta-hashes.po
    77  ./realloc.po
    78  ./ripemd160-compress.po
    79  ./ripemd160-meta.po
    80  ./ripemd160.po
    81  ./salsa20-crypt.po
    82  ./salsa20-set-key.po
    83  ./serpent-decrypt.po
    84  ./serpent-encrypt.po
    85  ./serpent-meta.po
    86  ./serpent-set-key.po
    87  ./sha1-compress.po
    88  ./sha1-meta.po
    89  ./sha1.po
    90  ./sha224-meta.po
    91  ./sha256-compress.po
    92  ./sha256-meta.po
    93  ./sha256.po
    94  ./sha384-meta.po
    95  ./sha512-compress.po
    96  ./sha512-meta.po
    97  ./sha512.po
    98  ./shadata
    99  ./testsuite/aes-test
   100  ./testsuite/arcfour-test
   101  ./testsuite/arctwo-test
   102  ./testsuite/base16-test
   103  ./testsuite/base64-test
   104  ./testsuite/bignum-test
   105  ./testsuite/blowfish-test
   106  ./testsuite/buffer-test
   107  ./testsuite/camellia-test
   108  ./testsuite/cast128-test
   109  ./testsuite/cbc-test
   110  ./testsuite/ctr-test
   111  ./testsuite/cxx-test
   112  ./testsuite/des-compat-test
   113  ./testsuite/des-test
   114  ./testsuite/des3-test
   115  ./testsuite/dsa-keygen-test
   116  ./testsuite/dsa-test
   117  ./testsuite/gcm-test
   118  ./testsuite/hmac-test
   119  ./testsuite/knuth-lfib-test
   120  ./testsuite/md2-test
   121  ./testsuite/md4-test
   122  ./testsuite/md5-compat-test
   123  ./testsuite/md5-test
   124  ./testsuite/memxor-test
   125  ./testsuite/meta-armor-test
   126  ./testsuite/meta-cipher-test
   127  ./testsuite/meta-hash-test
   128  ./testsuite/pkcs1-test
   129  ./testsuite/random-prime-test
   130  ./testsuite/ripemd160-test
   131  ./testsuite/rsa-encrypt-test
   132  ./testsuite/rsa-keygen-test
   133  ./testsuite/rsa-test
   134  ./testsuite/rsa2sexp-test
   135  ./testsuite/salsa20-test
   136  ./testsuite/serpent-test
   137  ./testsuite/sexp-format-test
   138  ./testsuite/sexp-test
   139  ./testsuite/sexp2rsa-test
   140  ./testsuite/sha1-huge-test
   141  ./testsuite/sha1-test
   142  ./testsuite/sha224-test
   143  ./testsuite/sha256-test
   144  ./testsuite/sha384-test
   145  ./testsuite/sha512-test
   146  ./testsuite/twofish-test
   147  ./testsuite/yarrow-test
   148  ./tools/nettle-hash
   149  ./tools/nettle-lfib-stream
   150  ./tools/pkcs1-conv
   151  ./tools/sexp-conv
   152  ./twofish-meta.po
   153  ./twofish.po
   154  ./twofishdata
   155  ./write-be32.po
   156  ./write-le32.po
   157  ./yarrow256.po
   158  ./yarrow_key_event.po
$ 

what the heck is a po file ? 

Anyways ... makefiles seem a bit off and a autoreconf --verbose --install may 
be needed after a tweak to Makefile.am or similar. 

Dennis 







_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to