Go to the first, previous, next, last section, table of contents.


Link mode

Link mode links together object files (including library objects) to form another library or to create an executable program.

mode-args consist of a command using the C compiler to create an output file (with the `-o' flag) from several object files.

The following components of mode-args are treated specially:

`-all-static'
If output-file is a program, then do not link it against any shared libraries at all. If output-file is a library, then only create a static library.
`-avoid-version'
Tries to avoid versioning (see section Library interface versions) for libraries and modules, i.e. no version information is stored and no symbolic links are created. If the platform requires versioning, this option has no effect.
`-dlopen file'
Same as `-dlpreopen file', if native dlopening is not supported on the host platform (see section Dlopened modules) or if the program is linked with `-static' or `-all-static'. Otherwise, no effect. If file is self libtool will make sure that the program can dlopen itself, either by enabling -export-dynamic or by falling back to `-dlpreopen self'.
`-dlpreopen file'
Link file into the output program, and add its symbols to lt_preloaded_symbols (see section Dlpreopening). If file is self, the symbols of the program itself will be added to lt_preloaded_symbols. If file is force libtool will make sure that lt_preloaded_symbols is always defined, regardless of whether it's empty or not.
`-export-dynamic'
Allow symbols from output-file to be resolved with dlsym (see section Dlopened modules).
`-export-symbols symfile'
Tells the linker to export only the symbols listed in symfile. The symbol file should end in `.sym' and must contain the name of one symbol per line. This option has no effect on some platforms. By default all symbols are exported.
`-export-symbols-regex regex'
Same as `-export-symbols', except that only symbols matching the regular expression regex are exported. By default all symbols are exported.
`-Llibdir'
Search libdir for required libraries that have already been installed.
`-lname'
output-file requires the installed library `libname'. This option is required even when output-file is not an executable.
`-module'
Creates a library that can be dlopened (see section Dlopened modules). This option doesn't work for programs. Module names don't need to be prefixed with 'lib'. In order to prevent name clashes, however, 'libname' and 'name' must not be used at the same time in your package.
`-no-fast-install'
Disable fast-install mode for the executable output-file. Useful if the program won't be necessarily installed.
`-no-install'
Link an executable output-file that can't be installed and therefore doesn't need a wrapper script. Useful if the program is only used in the build tree, e.g., for testing or generating other files.
`-no-undefined'
Declare that output-file does not depend on any other libraries. Some platforms cannot create shared libraries that depend on other libraries (see section Inter-library dependencies).
`-o output-file'
Create output-file from the specified objects and libraries.
`-release release'
Specify that the library was generated by release release of your package, so that users can easily tell which versions are newer than others. Be warned that no two releases of your package will be binary compatible if you use this flag. If you want binary compatibility, use the `-version-info' flag instead (see section Library interface versions).
`-rpath libdir'
If output-file is a library, it will eventually be installed in libdir. If output-file is a program, add libdir to the run-time path of the program.
`-R libdir'
If output-file is a program, add libdir to its run-time path. If output-file is a library, add -Rlibdir to its dependency_libs, so that, whenever the library is linked into a program, libdir will be added to its run-time path.
`-static'
If output-file is a program, then do not link it against any uninstalled shared libtool libraries. If output-file is a library, then only create a static library.
`-version-info current[:revision[:age]]'
If output-file is a libtool library, use interface version information current, revision, and age to build it (see section Library interface versions). Do not use this flag to specify package release information, rather see the `-release' flag.
`-Wl,flag'
`-Xlinker flag'
Pass a linker specific flag directly to the linker.

If the output-file ends in `.la', then a libtool library is created, which must be built only from library objects (`.lo' files). The `-rpath' option is required. In the current implementation, libtool libraries may not depend on other uninstalled libtool libraries (see section Inter-library dependencies).

If the output-file ends in `.a', then a standard library is created using ar and possibly ranlib.

If output-file ends in `.o' or `.lo', then a reloadable object file is created from the input files (generally using `ld -r'). This method is often called partial linking.

Otherwise, an executable program is created.


Go to the first, previous, next, last section, table of contents.