Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Migrating Guardian Applications to the OSS
Environment
Open System Services Porting Guide520573-006
8-25
Compiler Tools
Compiler Tools
In the Guardian environment, TNS C or C++ source modules are compiled using the
TACL C command with appropriate qualifiers and parameters. When the executable
program is built from more than one source module, each source module must be
compiled separately and bound using the BIND command in a separate step. The
BIND input file specifies all of the input object files and the libraries to be searched to
build the final executable file. If the executable is to be accelerated, this is done with a
separate command after the bind phase.
For the native environments, C compilation in the Guardian environment is performed
by the native C compilers (NMC for TNS/R native C, CCOMP for TNS/E native C) and
native C++ compilers (NMCPLUS for TNS/R native C++, CPPCOMP for TNS/E native
C++). In the OSS environment, the C compilation, linking, and optimization steps are
each performed indirectly using the appropriate parameters with the c89 utility, the
driver program for the native C compilers.
In the OSS environment, all of the compilation, linking, and optimization steps required
to build the final executables are specified in a make file. The make file, used by the
make utility, contains a list of dependencies for each target to be built. When migrating
Guardian programs written in C or C++ to the OSS environment, you are encouraged
to use the set of tools available in the OSS environment to build, test, and debug your
application.
The same Inspect, Native Inspect, and Visual Inspect debuggers available in the
Guardian environment are available in the OSS environment. Additional tools such as
ar(1), nm(1), strip(1), and strings(1) are also available in the OSS
environment. Read the appropriate reference pages for these tools online or in the
Open System Services Shell and Utilities Reference Manual.
Memory Models
In the OSS environment, only the wide memory model is supported. Thus, all modules,
Guardian and OSS, must be compiled with the wide memory model enabled. If the
original Guardian C or C++ source code used the small or large model, all 16-bit int
data elements become 32-bit int data elements. Thus, if your application requires 16
bits for a data element, use short rather than int. If your application requires 32 bits
for a data element, use long rather than int. If it does not matter whether the data
element is 16 bits or 32 bits, you can continue to use int. The use of the proper data
type is particularly important when calling a Guardian procedure which requires
parameters that are of a particular size.
Header Files
The header files used by the c89 utility in the OSS environment are located in the
/usr/include directory, as in other UNIX systems. The contents of the header files
are identical to the contents of the corresponding header files maintained in the
Guardian file system in $SYSTEM.SYSTEM. The contents of