-qstaticlink
Category
@PROCESS directive
None.
Purpose
Controls whether static or 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, -shared, and -shared-libgcc, used singly and in combination.
Syntax
.-nostaticlink-. >>- -q--+-staticlink---+--+-------------------+---------------->< | .-:----------. | | V | | '-=----+-libgcc-+-+-' '-xllibs-'
Defaults
-qnostaticlink
Parameters
- libgcc
- When you specify libgcc with nostaticlink, the compiler links the shared version of libgcc.
- When you specify libgcc with staticlink, the compiler links the static version of libgcc.
This suboption provides the equivalent ability that is enabled by the GNU options -static-libgcc and -shared-libgcc.
- xllibs
- When you specify xllibs with -qnostaticlink, the compiler links the shared version of the XL compiler libraries.
- When you specify xllibs with -qstaticlink, the compiler links the static version of the XL compiler libraries.
Usage
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 and -qmkshrobj, both options take effect. The compiler creates a shared object in which all references to the XL libraries are statically linked in.
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. See the following
examples:
Table 1. Examples of conflicting compiler options and resolutions Options combination Compiler behavior -qstaticlink=libgcc -qnostaticlink Shared libraries are linked. -qstaticlink -qnostaticlink=libgcc All libraries are linked statically. The compiler issues the following warning message: (W) The options -qnostaticlink=libgcc and -qstaticlink are incompatible. Option -qnostaticlink=libgcc is ignored. -qstaticlink -qnostaticlink=libgcc:xllibs All libraries are linked statically. The compiler issues the following warning messages: (W) The options -qnostaticlink=libgcc and -qstaticlink are incompatible. Option -qnostaticlink=libgcc is ignored. (W) The options -qnostaticlink=xllibs and -qstaticlink are incompatible. Option -qnostaticlink=xllibs is ignored. -qstaticlink -qstaticlink=libgcc All libraries are linked statically. -qnostaticlink=libgcc -qstaticlink All libraries are linked statically.
Important: Any use of third-party libraries or products is subject to the provisions in their respective licenses. Using the -qstaticlink option can have significant legal consequences for the programs that you compile. It is strongly recommended that you seek legal advice before you use this option.
| GNU option | Meaning | XL Fortran option |
|---|---|---|
| -shared | Build a shared object. | -qmkshrobj |
| -static | Build a static object and prevent linking with shared libraries. Every library that is linked to must be a static library. | -qstaticlink |
| -shared-libgcc | Link with the shared version of libgcc. | -qnostaticlink=libgcc 1 |
| -static-libgcc | Link with the static version of libgcc. You can still link your shared libraries. | -qstaticlink=libgcc |
Notes:
|
||



