foo (executable or library) from the C++ source code involves three steps: preprocessing, compilation and linking.
foo depends on a shared library
bar, whenever we execute
foo, we must be able to locate and load
ld.so scan different directories where to find
libbar.so in the following order:
RPATH. A list of directories which is linked into the executable, supported on most UNIX systems. It is ignored if
LD_LIBRARY_PATH. Environment variable which holds a list of directories.
RUNPATH. Same as
RPATH, but searched after
LD_LIBRARY_PATHand not universally supported.
/etc/ld.so.conf. Configuration file for
ld.sowhich lists additional library directories.
dyld locates each library using the full path to each dylib, so
foo must contain the install name for
bar. These dependencies can be seen using
otool -L foo.
RPATH. For relocatable libraries, these directories can contain
@executable_path(are replaced by the location of
@rpath(substituted with the RPATHs in
Use gnu nm to examine the object (*.o, library, etc.):
Being inexpert in LLDB, this is the workflow I follow to debug my R packages after they crash.
btto find out where are we in the code.
frame select 14.