Ha! OS X has the most complicated rpath logic I've ever seen. The library has to declare that it supports rpath for anything to apply, which seems…backwards. Not to mention that libA.dylib having "libB.dylib" as a dependent library is resolved relative to the executable opening libA.dylib, and not at all relative to libA.dylib :( . I can see why no one wants to rely on anyone else setting the paths via otool properly and instead just ships everything they need.
Ubuntu discussing moving to LTS + rolling release model
Posted Mar 2, 2013 0:02 UTC (Sat) by dashesy (subscriber, #74652)
[Link]
Yes, it is backward. Since 10.5 OSX has @rpath that more resembles Linux rpath however. I am not an expert in OSX but had to do some fiddling when porting some library. This is what I figured out, if libA.dylib depends on @rpath/libB.dylib (shown in otool -L) then you can use install_name_tool to add_rpath of @loader_path/. which should make the path relative to libA.dylib.