This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: libgcj-4 puts /usr/lib before LD_LIBRARY_PATH in any case


Yuval Kfir writes:
 > I wrote:
 > >  > We have a native shared library that depends on a library called
 > >  > libuuid.so.  This is not the default /usr/lib/libuuid.so but a
 > >  > completely different library, and the directory containing it is
 > the
 > >  > first directory in LD_LIBRARY_PATH.
 > 
 > Andrew Haley asked:
 > > 
 > > OK.  How is the native shared library that depends on libuuid.so
 > loaded?
 > > 
 > > What does 'ldd <libname>' say about it?
 > 
 > The Java class we're testing with consists simply of a single main
 > function that calls System.loadLibrary("wmdll").  The file libwmdll.so
 > is present in the current directory.
 > 
 > This is the output of 'ldd -r libwmdll.so'. Note the fourth library,
 > libuuid.

OK, I tried this:

I have two libraries in . libpoo.so and libpoo2.so

LD_LIBRARY_PATH=/mnt/zebedee:/home/aph/gcc/gcj-eclipse-merge-branch/install/lib64/

$ ldd libpoo.so
        libpoo2.so => /mnt/zebedee/libpoo2.so (0x00002aaaaabae000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aaaaacc7000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

public class p
{
  public static void main(String[] s)
  {
    System.loadLibrary("poo");
  }
}

 $ strace -f -etrace=file ./a.out
...
[pid  3019] open("/usr/lib64/gcj-4.1.1/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/mnt/zebedee/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/home/aph/gcc/gcj-eclipse-merge-branch/install/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/mnt/zebedee/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/home/aph/gcc/gcj-eclipse-merge-branch/install/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/usr/lib64/libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("libpoo.la", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] access("/usr/lib64/gcj-4.1.1/libpoo.so", R_OK) = -1 ENOENT (No such file or directory)
[pid  3019] access("/mnt/zebedee/libpoo.so", R_OK) = 0
[pid  3019] open("/mnt/zebedee/libpoo.so", O_RDONLY) = 7
[pid  3019] open("/mnt/zebedee/libpoo2.so", O_RDONLY) = 7
[pid  3019] open("/usr/share/locale/locale.alias", O_RDONLY) = 7
[pid  3019] open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
[pid  3019] open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)

I certainly can't see libgcj looking lin /usr/lib* for .so files.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]