[botan-devel] botan and sun4u

Jeremy C. Reed reed at reedmedia.net
Thu Apr 28 14:26:31 EDT 2011

I am using 

$ uname -imprsv 
SunOS 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V240


g++ (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

Using Botan 1.8.11 source.

$ ./configure.py 
  File "./configure.py", line 30
    from optparse import (OptionParser, OptionGroup,
SyntaxError: invalid syntax

$ which python

$ /usr/sfw/bin/python -V       
Python 2.3.3

$ ~/pkg/bin/python3.1 ./configure.py 
  File "./configure.py", line 613
    except KeyError, e:
SyntaxError: invalid syntax

That is Python 3.1.1.

Okay now I see doc/building.tex  mentions python versions... I 

$ ~/pkg/bin/python2.6 ./configure.py 
   INFO: Guessing to use compiler gcc
Unknown or unidentifiable processor "sun4u"

I worked around that by:

--- src/build-data/arch/sparc64.txt.orig        Thu Apr 28 13:09:14 2011
+++ src/build-data/arch/sparc64.txt     Thu Apr 28 13:09:42 2011
@@ -6,6 +6,7 @@

So then:

$ ~/pkg/bin/python2.6 ./configure.py 
   INFO: Guessing to use compiler gcc
   INFO: Guessing target processor is a sparc64/sun4u
   INFO: Target is gcc-solaris-sparc64-sun4u
   INFO: Skipping mod because CPU incompatible - asm_amd64 asm_ia32 
md4_ia32 md5_ia32 monty_amd64 mp_amd64 mp_ia32 mp_ia32_msvc mulop_amd64 
mulop_ia32 serpent_ia32 sha1_amd64 sha1_ia32 sha1_sse2 sse2_eng
   INFO: Skipping mod because OS incompatible - beos_stats cryptoapi_rng 
posix_rt win32_crit_section win32_query_perf_ctr win32_stats
   INFO: Skipping mod because loaded on request only - bzip2 gnump 
openssl qt_mutex zlib
   INFO: Skipping mod because loaded only if needed by dependency - 
amd64_eng ia32_eng mp_generic
   INFO: Botan 1.8.11 build setup is complete

But next problem was:

g++ -m64 -mno-app-regs -Ibuild/include -O2 -finline-functions -mcpu=v9 
-mtune=ultrasparc -D_REENTRANT -Wno-long-long -W -Wall -fPIC -c 
src/algo_factory/algo_factory.cpp -o build/lib/algo_factory.o
In file included from build/include/botan/curve_gfp.h:16,
                 from build/include/botan/point_gfp.h:15,
                 from build/include/botan/ec_dompar.h:12,
                 from build/include/botan/ecdsa_op.h:12,
                 from build/include/botan/engine.h:43,
                 from src/algo_factory/algo_factory.cpp:11:
build/include/botan/gfp_element.h:20:24: tr1/memory: No such file or 

I don't see this g++ header. And I didn't try with boost (even though I 
do have that).  It would be nice if the configure.py step checked for 
this before the make step.

So I do the configure.py again with  --with-tr1=none

Build is successful, but:

$ file libbotan.so
libbotan.so:    ELF 64-bit MSB dynamic lib SPARCV9 Version 1, 
dynamically linked, not stripped, no debugging information available

The libraries I use are like:

bash-3.00$ file /usr/lib/libc.so ~/pkg/lib/libcurl.so
/usr/lib/libc.so:       ELF 32-bit MSB dynamic lib SPARC32PLUS Version 
1, V8+ Required, dynamically linked, not stripped, no debugging 
information available
/udir/jreed/pkg/lib/libcurl.so: ELF 32-bit MSB dynamic lib SPARC Version 
1, dynamically linked, not stripped, no debugging information available

So attempting to link with the new libbotan fails for me:

ld: fatal: file /udir/jreed/pkg/lib/libbotan.so: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to conftest

Well I should have known from above about sparc64, so I reverted patch 
and did sun4u addition instead for src/build-data/arch/sparc32.txt.

So now failure is:

$ time make
g++ -m32 -mno-app-regs -Ibuild/include -O2 -finline-functions 
-mcpu=sun4u -Wa,-xarch=v8plus -D_REENTRANT -Wno-long-long -fpermissive 
-W -Wall -fPIC -c src/algo_factory/algo_factory.cpp -o 
src/algo_factory/algo_factory.cpp:1: error: bad value (sun4u) for -mcpu= 
*** Error code 1
make: Fatal error: Command failed for target `build/lib/algo_factory.o'

Anyone using botan with:

$ uname -p
$ uname -m


Any hints would be appreciated to get a 32-bit MSB dynamic library built 


  Jeremy C. Reed

echo 'EhZ[h ^jjf0%%h[[Zc[Z_W$d[j%Xeeai%ZW[ced#]dk#f[d]k_d%' | \
  tr            '#-~'            '\-.-{'

More information about the botan-devel mailing list