[lsb-discuss] Trying to link libreadline.a, LSB 4.0 on SLES11

Dallman, John john.dallman at siemens.com
Thu Apr 7 14:11:05 UTC 2016


I've been building the production build Parasolid solid-modelling library and its test harness to LSB standards for a long time, and it has worked well. There is also a build with a lot of debugging code compiled in that has not been built LSB until now, but I'm trying to fix that. The debugging build is used interactively much more than the production build, and has used GNU readline for many years. But that's where I'm stuck.

Readline is not an LSB-supported library at LSB 4.0.When I link, lsbcc forces it to be linked statically, which is what I want. But then the linker can't find a bunch of other symbols:

Warning: forcing readline to be linked statically
/usr/lib64/libreadline.a(util.o): In function `_rl_abort_internal':
/usr/src/packages/BUILD/readline-5.2/util.c:112: undefined reference to `__longjmp_chk'
/usr/lib64/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
/usr/src/packages/BUILD/readline-5.2/terminal.c:498: undefined reference to `PC'
/usr/src/packages/BUILD/readline-5.2/terminal.c:499: undefined reference to `BC'
/usr/src/packages/BUILD/readline-5.2/terminal.c:500: undefined reference to `UP'
/usr/src/packages/BUILD/readline-5.2/terminal.c:509: undefined reference to `PC'
/usr/src/packages/BUILD/readline-5.2/terminal.c:510: undefined reference to `BC'
/usr/src/packages/BUILD/readline-5.2/terminal.c:511: undefined reference to `UP'
/usr/lib64/libreadline.a(mbutil.o): In function `mbrlen':
/usr/include/wchar.h:399: undefined reference to `__mbrlen'
/usr/include/wchar.h:399: undefined reference to `__mbrlen'
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: ./kid.out: hidden symbol `stat' in /usr/lib64/libc_nonshared.a(stat.oS) is referenced by DSO
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

So I seem to be missing symbols __longjmp_chk, BC, PC, UP and __mbrlen, and all of those are undefined symbols in libreadline.a.

libc.so.6 has __longjmp_chk, and __mbrlen, but I don't know why they aren't being picked up. libc.so.6 does not have BC, PC or UP.

My link line is:

/opt/lsb/bin/lsbcc -m64 -Wformat -Wformat-security -D_FORTIFY_SOURCE=1 -fPIC /Parasolid/lx86/t281_test_lsb4/lsp/kernel.o /usr/local/sw_tools/lib/aga_fix.o -L/Parasolid/lx86/tools/lib/64 -lreadline /Parasolid/lx86/t281_test_lsb4/system/support_part1.so /Parasolid/lx86/t281_test_lsb4/system/support_part2.so /Parasolid/lx86/t281_test_lsb4/system/ps_part1.so /Parasolid/lx86/t281_test_lsb4/system/ps_part2.so /Parasolid/lx86/t281_test_lsb4/system/ps_part3.so /Parasolid/lx86/t281_test_lsb4/system/ps_part4.so /Parasolid/lx86/t281_test_lsb4/system/ps_part5.so /Parasolid/lx86/t281_test_lsb4/system/ps_part6.so /Parasolid/lx86/t281_test_lsb4/system/ps_part7.so /Parasolid/lx86/t281_test_lsb4/system/ps_part8.so -lncurses -lpthread -lX11 -lc -lm -ldl -Wl,-rpath,/Parasolid/lx86/tools/lib/64 -o kid.out

main() is in kernel.o, and the code that invokes readline functions is in support_part1.so or support_part2.so.

I'm working on 64-bit SLES11sp1, targeting LSB 4.0, with this collection of LSB packages:

lsb-build-base-4.0.1-1
lsb-build-c++-4.0.2-1
lsb-build-cc-4.0.1-1
lsb-build-desktop-4.0.1-1
lsb-build-qt3-4.0.0-5
lsb-build-qt4-4.0.1-1

I'm baffled, in part because I can't find a way to look at what symbols are in what sharable libraries. nm and objdump -t refuse for several of them.

Any suggestions?

--
John Dallman

-----------------
Siemens Industry Software Limited is a limited company registered in England and Wales.
Registered number: 3476850.
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lsb-discuss/attachments/20160407/245c996a/attachment.html>


More information about the lsb-discuss mailing list