Solaris SPARC to Solaris x86 Porting Guide
and code generation modules based on the instruction set for a particular hardware. The Sun Studio
12 Compiler Collection works on both the Solaris OS SPARC and x86 platforms; the front-end
component works the same for both, so the source code can be ported without changes. However,
when the intermediate code generated by the front-end has to be optimized, the backend compiler
flags are used. These are architecture dependent and are different for SPARC and x86 platforms.
Considering compiler
Sun Studio 12 Compiler Collection contains different options for back-end compiler flags on a wide
variety of SPARC processors as well as x86 architecture-based processors. It is useful when the code
is ported from one architecture to another, as there are equivalent options available in this compiler.
HP recommends using Sun Studio 8 Compiler Collection for a successful porting of source code from
the SPARC platform to the x86 platform. However, you can consider using the GCC compiler as well.
Compiler options for SPARC platform not used on x86 platform
The following options are used in the SPARC version of Sun Studio software. They are not present in
the x86 version. When a source program is compiled using these options on the Solaris OS, x86
Platform Edition, a warning is issued indicating an illegal option has been used, or the compiler
ignores the option.
Table 1: Options for Sun Studio (SPARC Version)
Compiler option Explanation Behavior on x86 version
-cg89 (C++) This option is the same as -xcg89 in cc.
Used for improving runtime performance
for the SPARC architecture. It compiles the
C++ code for generic SPARC architecture.
Equivalent to
-xtarget=ss2.
Warning issued by C++ compilers
[
1]
-cg92 (C++) This option is the same as -xcg92 in cc.
Used for improving runtime performance
for the SPARC architecture. It compiles the
C++ code for SPARC V8 architecture.
Equivalent to
-xtarget=ss1000.
Warning issued by C++ compiler
[
1]
-dalign (C) Equivalent to -xmemalign=8s. This
flag allows the user to specify the
maximum memory alignment of 8 bytes to
be assumed by the compiler in
indeterminable situations. It also specifies
that
SIGBUS be raised when misaligned
memory access takes place.
Option ignored [
3]
-fns
Turns on the SPARC nonstandard floating-
point mode. When nonstandard mode is
enabled, floating-point arithmetic may
produce results that do not conform to the
requirements of the IEEE 754 standard.
Option ignored [
3]
-misalign
Equivalent to -xmemalign=1i. This
flag allows the user to specify the
maximum memory alignment of 1 byte to
be assumed by the compiler in
indeterminable situations. This option
specifies that access be interpreted and
execution be continued, when a
misaligned memory access takes place.
Option ignored [
3]
-misalign2 (C) Equivalent to -xmemalign=2i. This
flag allows the user to specify the
maximum memory alignment of 2 bytes to
be assumed by the compiler in
Option ignored [
3]
10