Solaris Transition Guide

Search Path Rules

The dynamic linker and the runtime linker determine their search paths through a different algorithm from that used by the SunOS release 4.x linker.

The examples below compare the search paths for the dynamic linker and the runtime linker for SunOS release 4.x and the Solaris 7 operating environment. Notice that in the latter, the search path for the link editor and the runtime linker are affected by the LD_LIBRARY_PATH setting. However, the runtime linker permits programs to find shared libraries without having to set LD_LIBRARY_PATH and makes the loading of shared libraries even more efficient. Consequently, with Solaris 7, Sun recommends that you use $ORIGIN instead, since you must build your program with a built-in library path relative to where prog is installed. For example .../package/bin/prog uses .../package/lib/libmine.so.1.

SunOS release 4.x linker search paths:

Solaris 7 linker search paths (with LD_LIBRARY_PATH=dirlist1):

Solaris 7 linker search paths (with LD_LIBRARY_PATH=dirlist1,dirlist2):

Solaris 7 linker search paths using $ORIGIN

Also, with Solaris 7, LD_LIBRARY_PATH_64 is a 64-bit only version of LD_LIBRARY_PATH.