[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--as-needed linker option causes trouble with -lreadline/-ltermcap
From: |
Jim Meyering |
Subject: |
--as-needed linker option causes trouble with -lreadline/-ltermcap |
Date: |
Sat, 28 Mar 2009 15:22:14 +0100 |
When testing for the readline library, this works fine:
echo 'char readline (); int main () { return readline (); }' > k.c
gcc k.c -lreadline -ltermcap
but in order to work around portability problems years ago, gnulib's
lib-ignore.m4 makes it so the linker uses the --as-needed option:
gcc k.c -Wl,--as-needed -lreadline -ltermcap
and that fails on RHEL 5.3
(with binutils-2.17.50.0.6-9.el5.x86_64 and gcc-4.1.2-44.el5.x86_64):
/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'
/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 `UP'
/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 `tgoto'
/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 `BC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so:
undefined reference to `tgetstr'
collect2: ld returned 1 exit status
[Exit 1]
And that makes parted's configure script fail to detect readline,
which in turn resulted in some test failures.
I'll look into it more, eventually.
- --as-needed linker option causes trouble with -lreadline/-ltermcap,
Jim Meyering <=