This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: RFA: set LD_LIBRARY_PATH
Thomas Fitzsimmons writes:
> On Mon, 2005-09-05 at 14:05 +0100, Andrew Haley wrote:
> > Thomas Fitzsimmons writes:
> > >
> > > Sun's JRE includes $JAVA_HOME/lib/<arch> in its LD_LIBRARY_PATH so that
> > > users don't need to specify LD_LIBRARY_PATH manually. This patch makes
> > > libgcj do the same when the --with-java-home configure option is
> > > specified.
> > >
> > > OK for mainline?
> >
> > In what circumstances is this necessary?
>
> The specific use case I'm trying to support with this patch is running
> Java applications that link against libjawt.so. Sun installs this
> library in $JAVA_HOME/lib/<arch>. See:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21741
>
> > Should not the appropriate
> > libraries be installed somewhere where LD_LIBRARY_PATH isn't needed?
>
> We tried that before, see:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20790
>
> When our JAWT implementation was installed in GCC's library prefix it
> was overriding Sun's libjawt.so when compiling JAWT-using applications
> against proprietary VMs.
OK, so we renamed the lib to libgcjawt.so. Why can't libgcjawt.so be
installed in the common place for shared libraries, /usr/lib? Its
name prevents it from colliding with other libraries.
> > What if a user specifically sets LD_LIBRARY_PATH in order to _avoid_
> > $JAVA_HOME/lib/<arch>?
>
> They can't avoid it. But I don't know why they would want to. The idea
> here is that LD_LIBRARY_PATH only includes $JAVA_HOME/lib/<arch> when --
> with-java-home is specified.
I understand that, but most of our users don't build their own libgcj.
Making libgcj mess with LD_LIBRARY_PATH at runtime is a pretty evil
hack. If users are going to link their own programs with -ljawt, then
they're going to be setting LD_LIBRARY_PATH anyway.
I guess the problem is I still don't understand the scenario you have
in mind.
Andrew.