The value of
LIBRARY_PATHis a colon-separated list of directories, much like
PATH. When configured as a native compiler, GCC tries the directories thus specified when searching for special linker files, if it cannot find them using
GCC_EXEC_PREFIX. Linking using GCC also uses these directories when searching for ordinary libraries for the -l option (but directories specified with -L come first).
A list of directories in which to search for ELF libraries at execution-time. The items in the list are separated by either colons or semicolons. Similar to the
PATHenvironment variable. This variable is ignored in secure-execution mode.
Within the pathnames specified in
LD_LIBRARY_PATH, the dynamic linker expands the tokens
$PLATFORM(or the versions using curly braces around the names) as described above in
Rpath token expansion. Thus, for example, the following would cause a library to be searched for in either the
lib64subdirectory below the directory containing the program to be executed:
$ LD_LIBRARY_PATH='$ORIGIN/$LIB' prog
(Note the use of single quotes, which prevent expansion of
$LIBas shell variables!)