C3.10 How the linker searches for the Arm® standard libraries
The linker searches for the Arm® standard libraries using information specified on the command-line, or by examining environment variables.
By default, the linker searches for the Arm standard libraries
in ../lib, relative to the location of the armlink executable. Use the --libpath command-line option to specify a
different location.
The --libpath command-line option
Use the --libpath command-line option with a comma-separated list of
parent directories. This list must end with the parent directory of the Arm library directories
armlib, cpplib, and libcxx.
The sequential nature of the search ensures that armlink chooses the library that appears earlier in the list if two or more
libraries define the same symbol.
Library search order
The linker searches for libraries in the following order:
At the location specified with the command-line option --libpath.
In ../lib, relative to the location of
the armlink executable.
How the linker selects Arm® library variants
The Arm
Compiler toolchain includes a number of variants of each of the libraries, that are built
using different build options. For example, architecture versions, endianness, and
instruction set. The variant of the Arm library is coded into
the library name. The linker must select the best-suited variant from each of the
directories identified during the library search.
The linker accumulates the attributes of each input object and then selects the library
variant best suited to those attributes. If more than one of the selected libraries are
equally suited, the linker retains the first library selected and rejects all others.
The --no_scanlib option prevents the
linker from searching the directories for the Arm standard libraries.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.