HP-UX 11i March 2002 Release Notes

Programming
Libraries
Chapter 13
215
allow linking the string and memory routines archived but an application as a whole can
be linked shared.
There are now two different 32-bit system libraries. One is built for use on a PA1.1
machine and the other is built for use on a PA2.0 machine. The correct library is
installed at installation time. Other changes to these libraries include a decreased
calling overhead for the shared library. Also, the build process makes use of pragmas
introduced in release 10.20 to decrease the calling overhead in shared libraries.
In addition to the changes to the library builds, changes have been made to selected
header files to allow building applications that have decreased calling overhead. These
changes apply to both 32-bit and 64-bit applications.
Two new libraries are added: /usr/lib/libcres.a and
/usr/lib/pa20_64/libcres.a. These archive libraries include the common string and
memory functions along with a improved performance qsort routine. A few other
selected small routines are also included. The intent of this library is to allow an
application to link to this library archived while linking the application as a whole
shared. The use of this archived library is a supported link mode and will not introduce
the problems normally associated with a shared/archive link.
The 32-bit system libraries now have selected APIs built with the pragmas
HP_DEFINED_EXTERNAL, HP_LONG_RETURN, and HP_NO_RELOCATION. When these three
pragmas are used in the building of libc.sl, it is referred to as a fastcalled library. The
result of this is that the export stubs for the selected interfaces have been in-lined in the
library code, thus reducing call overhead. Applications that have already been built will
benefit from this without any effort other than the replacement of this library. The
benefit a given application will gain is very dependent on the application’s use of the
libc APIs that have been fastcalled.
Along with the changes to the build process for libc.2, the following header files have
been changed:
ctype.h
grp.h
mntent.h
pwd.h
stdio.h
stdlib.h
strings.h
string.h
time.h
These header files now contain the necessary fastcall pragmas to enable building a
fastcalled application. To make use of the pragmas to build the application,
_HP_SHLIB_CALLS needs to be defined for the application compile. With this define, the
application will now have the import stubs inlined in the application code, further
reducing the shared libary call overhead.
CAUTION An application that has been built with the _HP_SHLIB_CALLS define can only be used
with a fastcalled libc. If the application also has APIs that are fastcalled and are part of
the applications shared libraries, then that library must also be built with the fastcall
technology