-qstaticlink

Description

The -qstaticlink compiler option controls how shared and non-shared runtime libraries are linked into an application. This option provides the ability to specify linking rules that are equivalent to those implied by the GNU options -static, -static-libgcc, and -shared-libgcc, used singly and in combination.

Syntax

Read syntax diagramSkip visual syntax diagram        .-nostaticlink-.
>>- -q--+-staticlink---+--+-----------+------------------------><
                          '-=--libgcc-'
 

where

nostaticlink Instructs the compiler not to link statically with libgcc.a
staticlink Objects generated with this compiler option in effect will link only with static libraries.
libgcc When this suboption is specified together with nostaticlink, the compiler links to the shared version of libgcc.

When specified together with staticlink, the compiler links to the static version of libgcc.

Notes

GNU support for shared and non-shared libraries is controlled by the options shown in the following table.

Table 38. Option mappings: control of the Linux linker
GNU option Meaning XL C/C++ option
-shared Build a shared object. -qmkshrobj
-static Build a static object and prevent linking with shared libraries. Every library linked to must be a static library. Ignore when specified with -shared. -qstaticlink
-shared-libgcc Use the shared version of libgcc. Ignore when specified with -static. -qnostaticlink=libgcc
-static-libgcc Use the static version of libgcc. -qstaticlink=libgcc

Related information