HP-UX 11i June 2004 Release Notes
Programming
Libraries
Chapter 15
305
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
Although the build process for /usr/lib/pa20_64/libc.2 library has not changed, the
runtime architecture for PA-RISC 2.0 can make use of a reduced call overhead
technology similar to that which exists with the 32-bit library. There is no restriction on
matching the correct /usr/lib/pa20_64/libc.2 with the fastcalled application like
there is with the 32-bit library.
Impact
There is little to no impact from these changes, although there is a slight (125KB)
increase in amount of disk space required for libcres.a. The changes to the system
libraries are transparent to current applications.