Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
35
TABLE 4-1. EQUIVALENT COMPILER FLAGS AND WORKAROUNDS
GCC 4.4.5 OPTIONS ORACLE SOLARIS STUDIO 12.3
OPTIONS
DESCRIPTION
-ffast-math -xlibmopt Enables the compiler to use a library of optimized math routines.
Dynamic Linking Using Hardware-Specific Performance Libraries
Taking advantage of hardware properties specific to target platforms can result in a significant
performance improvement. For example, numerically intensive applications can utilize the specific
features of a target SPARC platform, such as the number of registers available for computation,
memory latency, and so on while generating the binaries for independent software vendor (ISV)
applications. The CPU-specific instruction set or the amount of data prefetching that is advantageous
on the target hardware architecture can be used, but note that this might not work or it might degrade
the performance on the other processors. It is not always feasible for an ISV to develop and distribute
different versions of an application specifically tuned for different platforms. However, some features
of the Oracle Solaris runtime linker allow different optimized libraries to be used on different
architectures within a single version of the application (transparent to the user).
One way to build platform-specific libraries is to use the $PLATFORM linker token, which can be
specified as a part of the runtime library path. The $PLATFORM token will expand at runtime as the
output of the uname -i command. As an example, consider two implementations of the same
library: one optimized for platforms based on the sun4u processor architecture and the default version
for all other Sun machines from Oracle:
$ find /opt/ISV -name libtmp.so
/opt/ISV/lib/sun4u/libtmp.so
/opt/ISV/lib/other/libtmp.so
Linking these libraries with the $PLATFORM token results in an executable that resolves the correct
library depending on the architecture detected at runtime.
$ setenv LD_OPTIONS '-R /opt/ISV/lib/$PLATFORM:/opt/ISV/lib/other'
Note: The /opt/ISV/lib/other directory explicitly specified in the runtime linker path ensures
that the default version of the /opt/ISV/lib/other/libtmp.so library will be used on
machines running versions of Oracle Solaris earlier than 2.6; anything else is, therefore, not capable of
using the $PLATFORM functionality.
In addition to $PLATFORM, tokens $OSNAME and $OSREL can be used, which expand to the
uname -s and uname -r outputs, respectively. The Oracle Solaris linker also allows shared
libraries that are specific to a particular instruction set to be specified via the $ISALIST token. At
runtime, this token is replaced by each of the native instruction sets on the platform shown by the
isalist command until the path containing $ISALIST points to an available implementation of
the library. Using platform-specific or instruction setspecific versions of numerically intensive