William A. Rowe, Jr. wrote: > Henry Jen wrote: >> William A. Rowe, Jr. wrote: >> >>> The issue I have is that your -enforcing- -R destroys my >>> -portability-. We >>> need to find a happy comprimize to build to a manditory -prefix >>> versus the >>> usual -prefix, yet relocatable (with LD_LIBRARY_PATH). >> >> Hmm, I am curious what portability is destroyed. :-) > I misunderstood the portability you referring to, thought it means other platforms. Glad to know that you are using Solaris and SunStudio. :-P > IIUC, before patch, my solaris binary can deployed at an arbitrary > /opt/apache2/ > location, apachectl resolves the LD_LIBRARY_PATH. Before patch, your > arbitrary > solution (linked to a thirdparty build of expat installed in > /usr/local/lib or > some other, nonstandard, location) fails to resolve libexpat.so at run > time. > -R gives a default search path, LIB_LIBRARY_PATH still can be used when needed. Quote `man ld.so.1` on Solaris: The runtime linker uses a prescribed search path for locat- ing the dynamic dependencies of an object. The default search paths are the runpath recorded in the object, fol- lowed by a series of defaults. For 32-bit objects, the defaults are /lib followed by /usr/lib. For 64-bit objects, the defaults are /lib/64 followed by /usr/lib/64. These defaults component can be modified using a configuration file that is created with crle(1). The runpath is specified when the dynamic object is constructed using the -R option to ld(1). The environment variable LD_LIBRARY_PATH can be used to indicate directories to be searched before the default directories. I work out the patch because I want to use the default expat installed by Solaris system(in /usr/sfw/lib, which is not in the default search path), not custom built or the one come with apr-util. > After patch, my solaris binary can no longer be redeployed to > /opt/httpd/, but > your binary finds your expat in /opt/sfw/lib or where ever. > This should not be true, but I could be overlooking. Would you please elaborate? The difference between with or without -R is the -R will be searched before the system default. Unless you got a different copy in the -R pointed path, there should be no difference. But I wonder how could that happen, -R is about to make sure you are getting the correct copy. > So my point is, if you want to add -R explicitly to your ldflags, that's > cool. > If you want to come up with a proposal to make this automatic but optional, > that's cool too. If you unilaterally decide your way is right, that's > not cool. > Your comment is very much appreciated, gives me a chance to exam my understanding. :-) Before we sort out the problem, how about let's remove the -R and commit the rest? That at least allows configure to locate the lib correctly. I will try to ping you on irc to have some discussion if you get some time. As the coolness, I want to work with the community to make sure I am doing the correct thing, which is why I always consult upstream team. It's the advise I got from Solaris engineers to use -R instead of change my system default setting with crle, and don't set LD_LIBRARY_PATH. Following two URLs have covered the topic. http://www.visi.com/~barr/ldpath.html http://linuxmafia.com/faq/Admin/ld-lib-path.html Thanks again for the comment, I really appreciate. Cheers, Henry