On 10.05.21 20:35, Thomas Jahns wrote:
What does
ldd libtclreadline.so
give?
Regards, Thomas
> ls -ald *readline*
-rw-r--r-- 1 dev1usr users 478680 29. Apr 22:28 libreadline.a
lrwxrwxrwx 1 dev1usr users 18 29. Apr 22:28 libreadline.so ->
libreadline.so.4.0
lrwxrwxrwx 1 dev1usr users 18 29. Apr 22:28 libreadline.so.4 ->
libreadline.so.4.0
-rw-r--r-- 1 dev1usr users 432556 29. Apr 22:28 libreadline.so.4.0
-rwxr-xr-x 1 dev1usr users 67656 10. Mai 21:03 libtclreadline-3.0.0.so
-rwxr-xr-x 1 dev1usr users 1109 10. Mai 21:03 libtclreadline.la
lrwxrwxrwx 1 dev1usr users 23 10. Mai 21:03 libtclreadline.so ->
libtclreadline-3.0.0.so
> ldd libtclreadline.so
linux-gate.so.1 (0xf7f1f000)
libncurses.so.6 => /lib/libncurses.so.6 (0xf7eb6000)
libreadline.so.4.0 => not found
libc.so.6 => /lib/libc.so.6 (0xf7cdb000)
libdl.so.2 => /lib/libdl.so.2 (0xf7cd6000)
libtinfo.so.6 => /lib/libtinfo.so.6 (0xf7cab000)
/lib/ld-linux.so.2 (0xf7f21000)
> objdump -p libtclreadline.so
libtclreadline.so: file format elf32-i386
Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
filesz 0x00003a28 memsz 0x00003a28 flags r-x
LOAD off 0x00003ec0 vaddr 0x00004ec0 paddr 0x00004ec0 align 2**12
filesz 0x00000284 memsz 0x000002a8 flags rw-
DYNAMIC off 0x00003ec8 vaddr 0x00004ec8 paddr 0x00004ec8 align 2**2
filesz 0x00000100 memsz 0x00000100 flags rw-
NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2
filesz 0x00000024 memsz 0x00000024 flags r--
EH_FRAME off 0x00003070 vaddr 0x00003070 paddr 0x00003070 align 2**2
filesz 0x00000084 memsz 0x00000084 flags r--
STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
filesz 0x00000000 memsz 0x00000000 flags rw-
RELRO off 0x00003ec0 vaddr 0x00004ec0 paddr 0x00004ec0 align 2**0
filesz 0x00000140 memsz 0x00000140 flags r--
Dynamic Section:
NEEDED libncurses.so.6
NEEDED libreadline.so.4.0
NEEDED libc.so.6
SONAME libtclreadline-3.0.0.so
INIT 0x00000ee8
FINI 0x000026a0
INIT_ARRAY 0x00004ec0
INIT_ARRAYSZ 0x00000004
FINI_ARRAY 0x00004ec4
FINI_ARRAYSZ 0x00000004
HASH 0x00000138
GNU_HASH 0x000002dc
STRTAB 0x00000730
SYMTAB 0x00000310
STRSZ 0x00000479
SYMENT 0x00000010
PLTGOT 0x00005000
PLTRELSZ 0x00000180
PLTREL 0x00000011
JMPREL 0x00000d68
REL 0x00000c60
RELSZ 0x00000108
RELENT 0x00000008
VERNEED 0x00000c30
VERNEEDNUM 0x00000001
VERSYM 0x00000baa
RELCOUNT 0x00000013
Version References:
required from libc.so.6:
0x09691f73 0x00 03 GLIBC_2.1.3
0x0d696910 0x00 02 GLIBC_2.0
from build
> ./configure {CC=gcc -m32 -O2} --prefix=... --enable-shared
--disable-static --with-readline-includes=...
{--with-readline-library=-L.../lib -lreadline} --with-tcl=.../lib
--with-tcl-includes=...
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-pc-linux-gnu
.....
/bin/sh ./libtool --tag=CC --mode=link gcc -m32 -O2 -g -O2 -release
3.0.0 -o libtclreadline.la -rpath "staging-dir" tclreadline.lo
-lncurses -L.../lib -lreadline
the problem is not that an EXTRA -rpath would probably help, the problem
is that the ld.so does not resolve an already known path.
================================================
Try1 : as you mentioned I add to Makefile.am hardcode -rapath
libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)
-Wl,-rpath,$(COMPILER_NATIVE)/lib
-> this works
================================================
Try2 : as you mentioned I add to Makefile.am ld.so relative -rpath
libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)
'-Wl,-rpath,$$ORIGIN/../lib'
-> this works too => partial solution
> ldd libtclreadline.so
linux-gate.so.1 (0xf7f6b000)
libncurses.so.6 => /lib/libncurses.so.6 (0xf7f02000)
libreadline.so.4.0 => .../lib/./../lib/libreadline.so.4.0
(0xf7ed5000)
libc.so.6 => /lib/libc.so.6 (0xf7cfa000)
libdl.so.2 => /lib/libdl.so.2 (0xf7cf5000)
libtinfo.so.6 => /lib/libtinfo.so.6 (0xf7cca000)
/lib/ld-linux.so.2 (0xf7f6d000)
================================================
Try3 : as you mentioned I add to Makefile.am ld.so relative -rpath
libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)
'-Wl,-rpath,$$ORIGIN'
-> this works too => partial solution
> ldd libtclreadline.so
linux-gate.so.1 (0xf7fbd000)
libncurses.so.6 => /lib/libncurses.so.6 (0xf7f54000)
libreadline.so.4.0 => .../lib/./libreadline.so.4.0 (0xf7f27000)
libc.so.6 => /lib/libc.so.6 (0xf7d4c000)
libdl.so.2 => /lib/libdl.so.2 (0xf7d47000)
libtinfo.so.6 => /lib/libtinfo.so.6 (0xf7d1c000)
/lib/ld-linux.so.2 (0xf7fbf000)
RUNPATH is set !!
> objdump -p libtclreadline.so
libtclreadline.so: file format elf32-i386
Program Header:
LOAD off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
filesz 0x00003a38 memsz 0x00003a38 flags r-x
LOAD off 0x00003eb8 vaddr 0x00004eb8 paddr 0x00004eb8 align 2**12
filesz 0x0000028c memsz 0x000002b0 flags rw-
DYNAMIC off 0x00003ec0 vaddr 0x00004ec0 paddr 0x00004ec0 align 2**2
filesz 0x00000108 memsz 0x00000108 flags rw-
NOTE off 0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**2
filesz 0x00000024 memsz 0x00000024 flags r--
EH_FRAME off 0x00003080 vaddr 0x00003080 paddr 0x00003080 align 2**2
filesz 0x00000084 memsz 0x00000084 flags r--
STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**4
filesz 0x00000000 memsz 0x00000000 flags rw-
RELRO off 0x00003eb8 vaddr 0x00004eb8 paddr 0x00004eb8 align 2**0
filesz 0x00000148 memsz 0x00000148 flags r--
Dynamic Section:
NEEDED libncurses.so.6
NEEDED libreadline.so.4.0
NEEDED libc.so.6
SONAME libtclreadline-3.0.0.so
RUNPATH $ORIGIN
INIT 0x00000ef0
FINI 0x000026b0
INIT_ARRAY 0x00004eb8
INIT_ARRAYSZ 0x00000004
FINI_ARRAY 0x00004ebc
FINI_ARRAYSZ 0x00000004
HASH 0x00000138
GNU_HASH 0x000002dc
STRTAB 0x00000730
SYMTAB 0x00000310
STRSZ 0x00000481
SYMENT 0x00000010
PLTGOT 0x00005000
PLTRELSZ 0x00000180
PLTREL 0x00000011
JMPREL 0x00000d70
REL 0x00000c68
RELSZ 0x00000108
RELENT 0x00000008
VERNEED 0x00000c38
VERNEEDNUM 0x00000001
VERSYM 0x00000bb2
RELCOUNT 0x00000013
Version References:
required from libc.so.6:
0x09691f73 0x00 03 GLIBC_2.1.3
0x0d696910 0x00 02 GLIBC_2.0
================================================
Try4 : as you mentioned I add to Makefile.am ld.so relative -rpath "."
libtclreadline_la_LDFLAGS = -release $(MAJOR).$(MINOR).$(PATCHLEVEL)
'-Wl,-rpath,.'
-> FAILURE: but ldd in the SAME directory works but NOT in other dir :-)
> ldd libtclreadline.so
linux-gate.so.1 (0xf7f90000)
libncurses.so.6 => /lib/libncurses.so.6 (0xf7f27000)
libreadline.so.4.0 => ./libreadline.so.4.0 (0xf7efa000)
libc.so.6 => /lib/libc.so.6 (0xf7d1f000)
libdl.so.2 => /lib/libdl.so.2 (0xf7d1a000)
libtinfo.so.6 => /lib/libtinfo.so.6 (0xf7cef000)
/lib/ld-linux.so.2 (0xf7f92000)
> ldd lib/libtclreadline.so
linux-gate.so.1 (0xf7fc0000)
libncurses.so.6 => /lib/libncurses.so.6 (0xf7f57000)
libreadline.so.4.0 => not found
libc.so.6 => /lib/libc.so.6 (0xf7d7c000)
libdl.so.2 => /lib/libdl.so.2 (0xf7d77000)
libtinfo.so.6 => /lib/libtinfo.so.6 (0xf7d4c000)
/lib/ld-linux.so.2 (0xf7fc2000)
I choose Try3 ....
so much time spend for a stupid single problem :-(
mfg