Joe Ammann
2010-Jan-22 00:21 UTC
[Samba] readline/termcap problems compiling Samba 3.5.0rc1 on CentOS 5.4 64-bit
Hi all
When I try to compile 3.5.0rc1 on CentOS 5.4, I get the seemingly well know
problem below
Linking bin/smbclient
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetnum'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetent'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetstr'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgoto'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `UP'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `BC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tputs'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `PC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetflag'
collect2: ld returned 1 exit status
make: *** [bin/smbclient] Error 1
I googled and read quite a bit, all links seem to suggest that either a missing
readline-devel and/or ncurses-devel might be the cuplrit. Now, I think I got
everything installed:
# rpm -qa --queryformat '%{name}\t%{version}\t%{arch}\n' | egrep
'(readline|curses|termcap)' | sort
libtermcap 2.0.8 i386
libtermcap 2.0.8 x86_64
libtermcap-devel 2.0.8 i386
libtermcap-devel 2.0.8 x86_64
ncurses 5.5 i386
ncurses 5.5 x86_64
ncurses-devel 5.5 i386
ncurses-devel 5.5 x86_64
readline 5.1 i386
readline 5.1 x86_64
readline-devel 5.1 i386
readline-devel 5.1 x86_64
termcap 5.5 noarch
A little testprogram fails with the same error, if I do
# gcc -o tt tt.c -lreadline
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `PC'
...
But succeeds if I either add -lcurses/-ltermcap or the linker flags that Samba
uses
gcc -o tt tt.c -Wl,-z,relro -Wl,--as-needed -Wl,--export-dynamic -lreadline
I checked the Makefile and config.log, it correctly determined the linker
flags to be
TERMLIBS=-lreadline -ltermcap
but still, I can't get rid of the above error. I'm a bit lost, any
hints?
--
CU, Joe
Joe Ammann
2010-Jan-28 15:06 UTC
[Samba] SOLVED: readline/termcap problems compiling Samba 3.5.0rc1 on CentOS 5.4 64-bit
Hi On Friday 22 January 2010 01:21:46 Joe Ammann wrote:> When I try to compile 3.5.0rc1 on CentOS 5.4, I get the seemingly well > know problem below > > Linking bin/smbclient > /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: > undefined reference to `tgetnum'I was finally able to solve my problem. The reason was the combination of 2 facts: - CentOS readline library does not declate dependency on curses/termcap - Samba compile uses the -Wl,--ad-needed link flag Then, although libtermcap is mentioned as library to link (-ltermcap), gcc does not include it - because no directly used library declares any dependency on it. I fixed my problem by using LDFLAGS="-Wl,--no-as-needed" ./configure...... to compile. -- CU, Joe
Björn Jacke
2010-Jan-29 17:00 UTC
[Samba] readline/termcap problems compiling Samba 3.5.0rc1 on CentOS 5.4 64-bit
On 2010-01-22 at 01:21 +0100 Joe Ammann sent off:> but still, I can't get rid of the above error. I'm a bit lost, any hints?this is a known issue of the RHEL5/CentOS packages, see https://bugzilla.samba.org/show_bug.cgi?id=6984 https://bugzilla.redhat.com/show_bug.cgi?id=499837 Cheers Bj?rn