H-Series Application Migration Guide (H06.03+)

H-Series Application Migration Guide429855-006
8-1
8 User Library Migration Tasks
This section explains how to migrate TNS/R native user libraries to TNS/E native user
libraries.Topics discussed are:
When the User Library is an SRL
When the User Library is a DLL on page 8-2
Specifying a User Library on page 8-2
A user library is an object file that the operating system links to a program file at run
time. A C, C++, COBOL, TAL, or pTAL program can have a user library. On the TNS/R
and TNS/E platforms, a native user library is available to native processes in the
Guardian and OSS environments. On both the TNS/R and TNS/E platforms, a program
can have only one native user library.
There are two kinds of TNS/R native user libraries. The type of user library depends on
whether the program and library consist of position-independent code (PIC) or non-
PIC. Non-PIC user libraries are a special form of shared run-time libraries (SRLs),
called private SRLs. PIC user libraries are dynamic-link libraries (DLLs).
On H-series systems, all object files consist of PIC and all libraries are DLLs; non-PIC
and SRLs are not supported. When migrating a non-PIC user library (SRL) to an
H-series system, the user library must be rebuilt as a DLL.
Migrating either type of TNS/R native user library (SRL or DLL) requires recompiling
and relinking to generate and link new codefiles consisting of Itanium instructions.
When the User Library is an SRL
Following is a summary of the differences between building a native non-PIC user
library (an SRL) on a G-series system and a native user library (a DLL) on an H-series
system:
For C and C++ programs:
°
In the Guardian environment, compile with CCOMP or CPPCOMP instead of
NMC or NMCPLUS. Replace the SRL pragma with the SHARED pragma.
°
In the OSS and PC environments, replace the -Wsrl flag with the -Wshared flag
on the c89 command.