Как Solaris определяет путь к библиотеке?
На Солярисе я могу использовать crle
Команда для настройки пути к библиотеке следующим образом:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib:/opt/DSI/32
Я также могу использовать традиционный LD_LIBRARY_PATH
метод, как это:
LD_LIBRARY_PATH="/export/home/donald/mysql-5.0.91-installed/lib/mysql/:/lib:/usr/lib"
Как Solaris определяет путь к библиотеке? Например, Solaris выбирает из crle path
будет первый LD_LIBRARY_PATH
? Я стараюсь google
, но не могу найти ответы.
1 ответ
Решение
Ответ в руководстве ( man ld.so.1).
The runtime linker uses a prescribed search path for locat-
ing the dynamic dependencies of an object. The default
search paths are the runpath recorded in the object, fol-
lowed by a series of defaults. For 32-bit objects, the
defaults are /lib followed by /usr/lib. For 64-bit objects,
the defaults are /lib/64 followed by /usr/lib/64. These
defaults component can be modified using a configuration
file that is created with crle(1). The runpath is specified
when the dynamic object is constructed using the -R option
to ld(1). The environment variable LD_LIBRARY_PATH can be
used to indicate directories to be searched before the
default directories.
Итак, заказ:
LD_LIBRARY_PATH
- общий объект RPATH
crle
по умолчанию