In Mac OS X, when using LLVM LD to link some C code (which will result in a shared library called libA.so
) that has a dependency to a shared library called libX.so
, the absolute full path of libX.so
is included in the list of shared libraries that libA.so
needs. In other words, when doing ldd libA.so
the following is shown:
(...)
/Users/foo/workspace/libX.so (compatibility version 0.0.0, current version 0.0.0)
(...)
How can one link the C code so that only the relative path of libX.so
is included? In other words, when doing ldd libA.so
the following is shown instead:
(...)
./workspace/libX.so (compatibility version 0.0.0, current version 0.0.0)
(...)