A new suboption xllibs has been added to the -qstaticlink option starting from the February 2014 Update for XL C/C++ for Linux, V12.1 (V22.214.171.124) and XL Fortran for Linux, V14.1 (V126.96.36.199).
The -qstaticlink option controls whether static or shared runtime libraries are linked into an application.
When you specify -qstaticlink without suboptions, only static libraries are linked with the object file. When you specify -qnostaticlink without suboptions, shared libraries are linked with the object file.
When you specify -qstaticlink=xllibs, the compiler links the static version of the XL compiler libraries. When you specify -qnostaticlink=xllibs, the compiler links the shared version of the XL compiler libraries.
Conflicting compiler options are resolved as follows:
If you first specify -qnostaticlink without suboptions and then specify -qstaticlink with or without suboptions, -qnostaticlink is overridden. For example, -qnostaticlink -qstaticlink=xllibs is equivalent to -qstaticlink=xllibs.
If you specify -qstaticlink with or without suboptions followed by -qnostaticlink without suboptions, -qnostaticlink takes effect and shared libraries are linked. Otherwise, once you have specified -qstaticlink without suboptions, -qstaticlink takes effect and only static libraries are linked with the object file. For examples, see IBM Support Portal.
If a runtime library is linked in statically while its message catalog is not installed on the system, messages are issued with message numbers only, and no message text is shown.
For XL C/C++ for Linux, V12.1, if a shared library or a dynamically linked application is supposed to throw or catch exceptions, you must link it with the shared libgcc with the -qnostaticlink=libgcc option in effect, which is the default.