Building 32-bit binaries on Solaris

Tim Bell tim.bell at oracle.com
Sat Nov 24 11:50:44 PST 2012


Hi Alan:

> I'm on a Solaris SPARC system and by default the new build generates 
> solaris-sparcv9 binaries. I'm looking to create 32-bit binaries which 
> is the default on the old build system (unless you specify 
> ARCH_DATA_MODEL) and trying to figure out the options to specify to 
> configure. The guide suggests that --with-host-bits is Windows only. 
> Is a build of 32-bit binaries considered a cross compile and should I 
> specify --host?

On my SPARC test system, running configure using '--with-target-bits=32' 
did the job, and created a configuration called 
'solaris-sparc-normal-server-release' right beside my existing 
'solaris-sparcv9-normal-server-release':

cd <top of tree>

sh ./configure \
     --with-tools-dir=/opt/devtools/sparc/SUNWspro/sunstudio12.1/bin \
     --with-cups=/opt/devtools/share/cups \
     --with-target-bits=32
[... snip ...]
Configuration summary:
* Debug level:    release
* JDK variant:    normal
* JVM variants:   server
* OpenJDK target: OS: solaris, CPU architecture: sparc, address length: 32


The build ran in 33 minutes (this was on a SPARC LDOM with 4CPUs granted 
to it, so nothing special to write home about):


% cd build/solaris-sparc-normal-server-release
% gmake all
Building Java(TM) for target 'all' in configuration 
'solaris-sparc-normal-server-release'
[... snip ...]
Finished building Java(TM) for target 'all'

% file jdk/bin/java
jdk/bin/java:   ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ 
Required, dynamically linked, not stripped

% jdk/bin/java -version
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 
1.8.0-internal-tbell_2012_11_24_10_59-b00)
Java HotSpot(TM) Server VM (build 25.0-b09, mixed mode)

Hope this helps-

Tim




More information about the build-infra-dev mailing list