brian.lu wrote: > Hi, experts, > > Thanks very much for your valuable help. > > Now I have another question: > On solaris, it is recommended to use RUNPATH instead of LD_LIBRARY_PATH > to locate shared libraries. > > For Mozilla, we use following way to locate shared libraries: > set "$ORIGIN: $ORIGIN/.." into every shared libraries' runpath (by using > -R '$ORIGIN:$ORIGIN/..' option). This works fine in the release build. > But in developer's workspace, Mozilla shared libraries are put under > directories "$MOZILLA_ROOT/dist/bin" and > "$MOZILLA_ROOT/dist/bin/components". > But these shared libraries are actually *symbol links* which link to > real shared libraries scattered in other sub-directories under > $MOZILLA_ROOT. > Shared libraries under "dist/bin/components" depend on some shared > libraries under "dist/bin". > > In this situation, $ORIGIN will have problem to locate shared libraries, > because $ORIGIN will be replaced with *real path* > (i.e. the symbol link points to). E.g. a shared library > dist/bin/components/libbar.so depends on dist/bin/libfoo.so. When > dist/bin/components/libbar.so is loaded > is will use libbar.so's *real-path/.. *instead of > *dist/bin/components/..* to try to locate libfoo.so. Of course, > ld.so.1 will fail to find it. > > To solve the problem, I want to use "*.*" to replace "$ORIGIN" in "-R" > option. Can I do that? > I think the only difference between "$ORIGIN" and "." is the way they > handle symbol link. Is that right?
No - that's not going to work out. The '.' translates to the current working directory for the process - not for the directory the object was loaded from - which is what you are looking for. _Mike_
