FC3 broken with HEAD

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: FC3 broken with HEAD
Date: 2005-05-06 13:13:20
Message-ID: 427B6D70.3070304@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

The recent ld --as-needed patch seems to break psql on FC3: it fails to
start with "symbol lookup error: /usr/lib64/libreadline.so.4: undefined
symbol: BC". You can see this on the FC3 build farm machine:


My current theory on why this happens is the following:

- RH's readline is built so that an application that links against
readline must also link against libtermcap

- libtermcap provides the "BC" symbol which libreadline references

- for some reason that isn't clear to me, ld --as-needed removes the
libtermcap dependency from the generated psql executable; with the
patch, ldd on psql on FC3 shows:

libpq.so.4 => /opt/pg/cvs-die/install/lib/libpq.so.4 (0xb7fd1000)
libreadline.so.4 => /usr/lib/libreadline.so.4 (0xb7f8a000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e5f000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7e31000)
libresolv.so.2 => /lib/libresolv.so.2 (0xb7e1d000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7e07000)
/lib/ld-linux.so.2 (0xb7fe8000)

This looks supiciously like an ld bug: -ltermcap is specified on the
link line, and the resulting executable requires it, but ld does not
link against it.

So, it seems we'll need to back out the patch. I think we could probably
still use --as-needed for the rest of the tree (just not with psql), but
that's pretty ugly, and I'm nervous using a linker flag in part of the
tree that we know is broken for another part.


I haven't reverted the patch yet as I want to make sure I understand the
situation correctly first. In the meantime FC3 users should be able to
configure --without-readline, or just remove the -Wl,--as-needed stuff
from configure.



Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2005-05-06 13:51:48 Re: [pgsql-advocacy] Increased company involvement
Previous Message Robert Treat 2005-05-06 13:08:10 Re: Views, views, views! (long)