| |||
| Home > Using the ARM Librarian > Library searching, selection, and scanning > Searching for ARM libraries | |||
You can specify the search paths used to find the ARM standard libraries by:
Using the environment
variable RVCT31LIB. This is the default.
Adding the --libpath option to
the armlink command line with a comma-separated
list of parent directories.
This list must end with the parent directory of the ARM library
directories armlib and cpplib.
The RVCT31LIB environment variable holds this
path.
The linker command-line option --libpath overrides
the paths specified by the RVCT31LIB variable.
The linker combines each parent directory, given by either --libpath or
the RVCT31LIB variable, with each subdirectory
request from the input objects and identifies the place to search
for the ARM library. The names of ARM subdirectories within the
parent directories are placed in each compiled object by using a
symbol of the form Lib$$Request$$.sub_dir_name
The sequential nature of the search ensures that the linker chooses the library that appears earlier in the list if two or more libraries define the same symbol.
There are different variants of the ARM libraries based on the attributes of their member objects. 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 final list contains all the libraries that the linker scans in order to resolve references.
For more information on library variants, see the Chapter 2 The C and C++ Libraries in the Libraries Guide.