Patch: RFA: set LD_LIBRARY_PATH

Thomas Fitzsimmons fitzsim@redhat.com
Mon Sep 5 16:10:00 GMT 2005


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.

> 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.  This configure option implies a more SDK-
like environment (read java-gcj-compat).  This patch makes libgcj behave
more like the SDK in its handling of LD_LIBRARY_PATH and
java.library.path when --with-java-home is specified.

Tom




More information about the Java-patches mailing list