The -qstaticlink compiler option controls how shared and non-shared run-time libraries are linked into an application. The XL 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.
.-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.
GNU support for shared and non-shared libraries is controlled by the
options shown in the following table.
Option mappings: control of the Linux linker | ||
GNU option | Meaning | XL 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 |