Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
the c89 utility (or the c99 utility, if applicable), link object files using the nld, ld, or eld utility,
and use the SQL/MP compiler on the resulting object file or the SQL/MX compiler on the resulting
module definition file (if necessary). The native C compilers accept ISO/ANSI C as well as Common
C. The native C++ compilers have more features than the TNS C++ preprocessor, such as forward
declarations of class specializations and nested templates, and make it easier to debug code.
There are significant benefits to using the native C and C++ compilers. They compile code faster
than the TNS compiler and the Accelerator or Object Code Accelerator, and may produce faster
code. The native C and C++ cross compilers run in the Guardian and OSS environments, as well
as on the PC (through NSDEE or ETK), and, for G-series systems only, on the HP Tandem
Development Suite (TDS) on a PC. For more information on using the NSDEE on a PC, refer to the
NSDEE online help. For more information on using the ETK on a PC, refer to the ETK online help.
For more information on using the TDS on a PC, refer to the C/C++ Programmer’s Guide or to the
TDS online help.
The native linkers, nld, ld, and eld replace the Binder in native development environments; they
link object files to produce an executable file. Native object files can be read from an archive file
produced by the ar utility as well as from files specified on the c89 or c99 command line. Virtually
identical parameters for nld, ld, and eld are supported in the Guardian environment as in the
OSS environment.
The native object file tools, noft and enoft, can be used to display all parts of native object
files, such as headers, program text and data (source and object), symbol table and components,
run-time procedure table, relocation tables, and run-time data units. noft and enoft can be used
to generate cross reference information for procedures. Again, they support virtually identical
Guardian and OSS interfaces.
TNS/R native programs can be debugged using the same PC-based Visual Inspect or command
line Inspect debuggers used to debug TNS programs. TNS/E native programs require the use of
Visual Inspect or Native Inspect; Native Inspect is entirely different from Inspect (Inspect on TNS/E
systems cannot be used for TNS/E native debugging). You should also be aware of a few differences
in moving from TNS interpreted and TNS accelerated debugging to optimized native debugging.
Unlike accelerated code, TNS environment registers do not exist in native code. Variables might
remain in registers and never be written to memory. Native C compilers support three levels of
optimization:
• 0 for no optimization
• 1 for most optimizations, good performance
• 2 for full optimizations, about a 15-percent decrease in processor path length over 1
Optimization modes 0 and 1 support symbolic debugging. Optimization mode 2 also supports
symbolic debugging, but variables are more often optimized away, and code rearrangement
introduces uncertainty when stepping through statements or setting breakpoints at source line
numbers.
The native C compilers can be directed to accept C source files conforming to Kernigan and Ritchie
(K&R) C or Common C in addition to ISO/ANSI C. However, HP does not provide a complete set
of header files that conform to K&R C. The user must modify existing header files or obtain files
from another source to compile K&R C source files.
Beginning with the H06.24 and J06.13 RVUs, many new 64-bit features have been added to the
C/C++ compilers, eld linker, Native Inspect debugger, and enoft utility. For information about
these new 64-bit features, see the 64-Bit Support in OSS and Guardian chapter in the Open System
Services Programmer's Guide.
User Library Migration Issues
User libraries are supported in the native environments as well as the TNS environment. C, C++,
and pTAL programs can have a user library; that is, an object file that the operating system links
to a program file at run time.
User Library Migration Issues 173