Tiny Core Linux
Tiny Core Extensions => TCE Bugs => Topic started by: polikuo on April 04, 2021, 10:02:49 AM
-
TC 12.0 x86_64
/usr/local/bin/awk from gawk.tcz reports
$ printf '\tTAB' | /use/local/bin/awk '/\t/'
symbol lookup error: /usr/local/lib/libreadline.so.8: undefined symbol: UP
-
Hi polikuo
Does this show anything missing:
ldd /usr/local/lib/libreadline.so.8
-
Not really
Here are some tests
tc@box: ~ $ ldd /usr/local/lib/libreadline.so.8
linux-vdso.so.1 (0x00007ffe2f1c1000)
libc.so.6 => /lib/libc.so.6 (0x00007fa07e9f5000)
/lib/ld-linux-x86-64.so.2 (0x00007fa07ebe0000)
tc@box: ~ $ /lib/ld-linux-x86-64.so.2 --verify /usr/local/lib/libreadline.so.8
tc@box: ~ $ echo $?
2
tc@box: ~ $ ldd /usr/lib/libc.so
/usr/lib/libc.so: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
tc@box: ~ $ /lib/ld-linux-x86-64.so.2 --verify /usr/lib/libc.so
tc@box: ~ $ echo $?
1
tc@box: ~ $ ldd /lib/libc.so.6
/lib/ld-linux-x86-64.so.2 (0x00007f1e918e3000)
linux-vdso.so.1 (0x00007ffcb71fb000)
tc@box: ~ $ /lib/ld-linux-x86-64.so.2 --verify /lib/libc.so.6
tc@box: ~ $ echo $?
0
tc@box: ~ $ ldd /usr/local/bin/awk
linux-vdso.so.1 (0x00007fffd0335000)
libreadline.so.8 => /usr/local/lib/libreadline.so.8 (0x00007f880aa4e000)
libmpfr.so.6 => /usr/local/lib/libmpfr.so.6 (0x00007f880a79f000)
libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x00007f880a71d000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f880a718000)
libm.so.6 => /lib/libm.so.6 (0x00007f880a5f4000)
libc.so.6 => /lib/libc.so.6 (0x00007f880a470000)
/lib/ld-linux-x86-64.so.2 (0x00007f880aab5000)
tc@box: ~ $ /lib/ld-linux-x86-64.so.2 --verify /usr/local/bin/awk
tc@box: ~ $ echo $?
0
tc@box: ~ $ nm /usr/local/lib/libreadline.so.8 | grep UP
U UP
-
Hmm - normally readline should depend on ncursesw - I'll take a look tomorrow.
-
Hi polikuo
... tc@box: ~ $ ldd /usr/lib/libc.so
/usr/lib/libc.so: error while loading shared libraries: /usr/lib/libc.so: invalid ELF header
...
The libc.so library tends to be very stable and rarely changes since everything (including the kernel) depends on it. So
seeing another libc.so in /usr/lib/ struck me as odd. Turns out it is provided by glibc_base-dev.tcz and is not a shared
library at all. It appears to contain directives for the linker. Run this and see for yourself:
cat /usr/lib/libc.so
... tc@box: ~ $ nm /usr/local/lib/libreadline.so.8 | grep UP
U UP
The U means that symbol UP is undefined and is expected to be found in an external executable (dependency).
I see UP defined in libncursesw.so.
-
I've checked readline in both tc-12.x x86 and x86_64 and both give this:
$ ldd /usr/local/lib/libreadline.so.8
linux-vdso.so.1 (0x00007fffe78aa000)
libncursesw.so.6 => /usr/local/lib/libncursesw.so.6 (0x00007f3eabd3e000)
libc.so.6 => /lib/libc.so.6 (0x00007f3eabbb1000)
/lib/ld-linux-x86-64.so.2 (0x00007f3eabde5000)
$ nm /usr/local/lib/libreadline.so.8 | grep UP
nm: /usr/local/lib/libreadline.so.8: no symbols
$ printf '\tTAB' | /use/local/bin/awk '/\t/'
sh: /use/local/bin/awk: not found
Are you working with a locally compiled version of readline?
-
Are you working with a locally compiled version of readline?
Oops :-[
Sorry for the noise, I totally forgot about that I haven't reboot yet.
I was trying to build gcc and all the deps natively to see the difference in performance.
CXXFLAGS='-march=native -mtune=native -Ofast -pipe -fuse-linker-plugin -flto -fno-exceptions -fno-rtti'
tce-load -fi tool-ncursesw
../configure --with-curses
I guess simply overwriting the current ncursesw with "-fi" is not the way to go.
-
You might want to explicitly state your cpu (-march=haswell in my case) - I'm not convinced that all source code will use it otherwise.
You can check by running ./configure in the gmp source code, or: $ gcc -mcpu=native -march=native -Q --help=target
-
Hi Juanito
... $ nm /usr/local/lib/libreadline.so.8 | grep UP
nm: /usr/local/lib/libreadline.so.8: no symbols
...
Thank you for posting that. I was getting that result with every library I tried under TC10 x86 even though midnight commander
showed that symbols were present. I don't know why nm couldn't list symbols, but readelf could:
tc@E310:~$ readelf -s /usr/local/lib/libreadline.so.7 | grep UP
274: 00000000 0 OBJECT GLOBAL DEFAULT UND UP
tc@E310:~$ readelf -s /usr/local/lib/libncursesw.so.6 | grep UP
329: 00043d04 4 OBJECT GLOBAL DEFAULT 22 UP
tc@E310:~$
-
nm lists static symbols by default, which we usually strip. Use "nm -D" on dynamic libraries.
-
Hi curaga
That worked. Thank you.