Solaris SPARC to Solaris x86 Porting Guide

-xarch=v8plus—Specifies the target instruction set architecture (ISA). This option is used to
override the -xarch option used in the -xtarget option because this value is more suitable for
enabling the compiler to generate code for good performance on the V8plus ISA.
The abovementioned compiler options work with the SPARC version, but if the same macros or
compiler flags must be used on the x86 architecture, then not all of them are supported by the x86
platform. However, the same macro or option might be used on x86 with different values.
Some of the SPARC options used to compile the Apache Web Server in this case study can be used
on the x86 platform, but with different values. The options that can be used on the x86 version of the
compiler are as follows:
-fast—The purpose of this option in x86 architecture is the same as the SPARC compiler version,
but it expands to a different set of values on the x86 version. On x86, this macro is the equivalent
of:
-fns -fsingle -ftrap=%none -nofstore -xarch=native -xbuiltin=%all -
xdepend -xlibmil -xO5
-xtarget=pentium_pro—This option is used to specify the target system for instruction set and
optimization. The -xtarget macro expands to:
-xarch=pentium_pro -xchip=pentium_pro -xcache=generic
Building the application on Solaris 10 OS, x86 Platform Edition
The same utilities are used on the x86 machine:
1. configure
The configure utility is run without any modification in the flags used for the SPARC version to
obtain the Makefiles. This is done as follows:
CFLAGS=" -xparallel -fast -xtarget=ultra -xarch=v8plus" \
LDFLAGS=" -xparallel -fast -xarch=v8plus" \
./configure --prefix=/home/testuser/apache/apache2
2. make
The make utility is used to build the application from the source code. When the same compiler
flags are used on the x86 machine, the option -xparallel is ignored, while the options
xarch and -xtarget provide the following compiler warnings:
cc: Warning: illegal option -xtarget=ultra4
cc: Warning: illegal option -xarch=v8plus
To prevent these warnings, a different set of compiler flags is used on the x86 platform. For the
compiler flags used, see the
Solution for Solaris OS x86 Platform Edition section.
3. make install
The make install utility installs the Apache package in the path specified by the option -
prefix during the configuration process.
Solution for Solaris x86: When built using the flags given by the SPARC version compiler, the
source code provides a warning that improper options had been used. To compile the source on
the x86 machine, the flag values are changed to:
CFLAGS= -fast -xtarget=pentium_pro -xarch=pentium_pro \
LDFLAGS= -fast -xarch=pentium_pro \
./configure –prefix=/home/testuser/apache/apache2
The explanation of these options is:
-fast—This macro differs from the SPARC platform in the options it expands to.
24