Re: --as-needed linker option causes trouble with -lreadline/-ltermcap

2009-03-29 Thread Bruno Haible
Ralf Wildenhues wrote: > Anyway, I thought CVS binutils had a patch to deal with this setup, > but reading the ld/NEWS entry, I'm not so sure anymore whether it > is sufficient: > > * --as-needed now links in a dynamic library if it satisfies undefined > symbols in regular objects, or in oth

Re: --as-needed linker option causes trouble with -lreadline/-ltermcap

2009-03-28 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Sat, Mar 28, 2009 at 05:02:36PM CET: > * Jim Meyering wrote on Sat, Mar 28, 2009 at 03:22:14PM CET: > > gcc k.c -Wl,--as-needed -lreadline -ltermcap > To work around it in the test, I suppose you can link a program > that also requires a symbol from termcap. Hmm. T

Re: --as-needed linker option causes trouble with -lreadline/-ltermcap

2009-03-28 Thread Jim Meyering
Ralf Wildenhues wrote: > libreadline depends upon libtermcap, but does not announce this > dependency with a DT_NEEDED entry (i.e., -ltermcap was not passed > to the command creating libreadline.so). This is arguably a bug > in libreadline (but probably done intentionally to allow choosing > eithe

Re: --as-needed linker option causes trouble with -lreadline/-ltermcap

2009-03-28 Thread Ralf Wildenhues
Hi Jim, * Jim Meyering wrote on Sat, Mar 28, 2009 at 03:22:14PM CET: > 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