On 01.05.2016 21:00, Mike Frysinger wrote:
On 01 May 2016 09:18, Robert Boehne wrote:
Run it under gdb and see why it doesn't find the library.
or use strace -- that'll show quickly all the files/paths that the
program is trying to use
-mike
thanks, I underestimated strace until now. I executed following commands:
* Library name "gneural" and command LD_LIBRARY_PATH=/opt/gneural/lib
strace ./dlopen
access("/opt/gneural/lib/gneural", R_OK) = -1 ENOENT (No such file or
directory)
access("/usr/lib/gneural", R_OK) = -1 ENOENT (No such file or
directory)
access("/usr/lib32/gneural", R_OK) = -1 ENOENT (No such file or
directory)
open("/opt/gneural/lib/gneural", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No
such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=259355, ...}) = 0
mmap(NULL, 259355, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc386998000
close(3) = 0
open("/usr/lib/tls/x86_64/gneural", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No
such file or directory)
[...]
open("/usr/lib/gneural", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file
or directory)
stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=169152, ...}) = 0
munmap(0x7fc386998000, 259355) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
write(1, "file not found\n", 15file not found
) = 15
exit_group(0) = ?
+++ exited with 0 +++
* Name "gneural" and command LD_LIBRARY_PATH= strace ./dlopen
It doesn't even look in /opt/gneural/lib, even though directory is in
/etc/ld.so.conf.d file.
* Name "libgneural.so" and command LD_LIBRARY_PATH=/opt/gneural/lib
strace ./dlopen
I tried this name because strace shows that it uses the name verbatim
without some magic.
open("/opt/gneural/lib/libgneural.so", O_RDONLY|O_CLOEXEC) = 3
read(3,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\30\0\0\0\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=125152, ...}) = 0
mmap(NULL, 2132376, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x7f55cfd54000
mprotect(0x7f55cfd5d000, 2093056, PROT_NONE) = 0
mmap(0x7f55cff5c000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x7f55cff5c000
close(3) = 0
munmap(0x7f55d08ef000, 259355) = 0
munmap(0x7f55cfd54000, 2132376) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
write(1, "file not found\n", 15file not found
) = 15
exit_group(0) = ?
+++ exited with 0 +++
It opens the library but still reports that file is not found. Do you
know why? Also, despite Roberts remark about removing lib prefix, I had
to specify full name. Why is that?
Best regards
_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool