Thread: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10

9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10

From
Mark Kirkwood
Date:
Since libedit is getting some attention right now, I figured I'd try 
using building with it instead of readline. configuring using:

./configure --prefix=/usr/local/pgsql/9.1 --enable-debug 
--enable-cassert --with-libedit-preferred

I get this linking postgres:

postmaster/postmaster.o: In function `PostmasterMain':
/home/postgres/develop/c/postgresql/src/backend/postmaster/postmaster.c:755: 
undefined reference to `optreset'
tcop/postgres.o: In function `process_postgres_switches':
/home/postgres/develop/c/postgresql/src/backend/tcop/postgres.c:3457: 
undefined reference to `optreset'
utils/misc/ps_status.o: In function `set_ps_display':
/home/postgres/develop/c/postgresql/src/backend/utils/misc/ps_status.c:314: 
undefined reference to `setproctitle'

What seems to be going on is that libedit defines optreset, which then 
messes up the various other bits of logic in utils/misc/ps_status.c so 
it thinks it has setproctitle on Linux. The other files 
postmaster/postmaster.c and tcop/postgres.c get tricked into thinking 
they have optreset.

I'm not sure how important this is, given that even if I (bodge) these 
errors away, I merely confirm that libedit multi-byte input is busted in 
the version shipped with Ubuntu 10.10.

Cheers

Mark



Mark Kirkwood <mark.kirkwood@catalyst.net.nz> writes:
> Since libedit is getting some attention right now, I figured I'd try 
> using building with it instead of readline. configuring using:

> ./configure --prefix=/usr/local/pgsql/9.1 --enable-debug 
> --enable-cassert --with-libedit-preferred

> I get this linking postgres:

> postmaster/postmaster.o: In function `PostmasterMain':
> /home/postgres/develop/c/postgresql/src/backend/postmaster/postmaster.c:755: 
> undefined reference to `optreset'
> tcop/postgres.o: In function `process_postgres_switches':
> /home/postgres/develop/c/postgresql/src/backend/tcop/postgres.c:3457: 
> undefined reference to `optreset'
> utils/misc/ps_status.o: In function `set_ps_display':
> /home/postgres/develop/c/postgresql/src/backend/utils/misc/ps_status.c:314: 
> undefined reference to `setproctitle'

> What seems to be going on is that libedit defines optreset, which then 
> messes up the various other bits of logic in utils/misc/ps_status.c so 
> it thinks it has setproctitle on Linux.

It's pretty hard to see how those two things would be related.  I think
more likely libedit is providing a function named setproctitle, which
seems like a rather stupid thing for them to have done.

The optreset thing is probably the same ilk of issue, ie, libedit
providing such a symbol and configure then being fooled into expecting
it to be present in the standard libraries.

We could possibly fix this by delaying the test for libedit till after
we've tested for unrelated stuff, but that seems pretty klugy.

> I'm not sure how important this is, given that even if I (bodge) these 
> errors away, I merely confirm that libedit multi-byte input is busted in 
> the version shipped with Ubuntu 10.10.

There's that too :-(
        regards, tom lane


Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10

From
Mark Kirkwood
Date:
On 16/02/11 14:54, Tom Lane wrote:
>
> It's pretty hard to see how those two things would be related.  I think
> more likely libedit is providing a function named setproctitle, which
> seems like a rather stupid thing for them to have done.

You are correct - it defines setproctitle, good grief.


Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10

From
Mark Kirkwood
Date:
On 16/02/11 15:05, Mark Kirkwood wrote:
> On 16/02/11 14:54, Tom Lane wrote:
>>
>> It's pretty hard to see how those two things would be related.  I think
>> more likely libedit is providing a function named setproctitle, which
>> seems like a rather stupid thing for them to have done.
>
> You are correct - it defines setproctitle, good grief.
>

...for some level of completeness in case this comes up again: it is not 
libedit that is at fault here. I downloaded the src for versions 2 amd 3 
and neither setproctitle not optreset are defined anywhere. Looking at 
my Ubuntu install reveals:
 $ ldd /usr/lib/libedit.so.2    linux-vdso.so.1 =>  (0x00007fffd1bd3000)    libbsd.so.0 => /lib/libbsd.so.0
(0x00007ff219cc9000)   libncurses.so.5 => /lib/libncurses.so.5 (0x00007ff219a85000)    libc.so.6 => /lib/libc.so.6
(0x00007ff219701000)   libdl.so.2 => /lib/libdl.so.2 (0x00007ff2194fd000)    /lib64/ld-linux-x86-64.so.2
(0x00007ff21a120000)

What's this libbsd then eh? Sure enough it is this guy that defines 
these symbols. So it is the way it is being built on the Ubuntu (or 
Debian) platform.

Cheers

Mark


On Wed, Feb 16, 2011 at 2:43 AM, Mark Kirkwood
<mark.kirkwood@catalyst.net.nz> wrote:
> What's this libbsd then eh? Sure enough it is this guy that defines these
> symbols. So it is the way it is being built on the Ubuntu (or Debian)
> platform.

Oh, for what it's worth there are several different libedits out there
with various related heritages. It's possible you're looking at two
completely different packages.

On Debian /usr/share/doc/<package>/README.Debian is supposed to say
where the upstream source was.

-- 
greg


Look at the libeditline-dev packages I think those might be more
modern than the libedit packages.

But I'm not sure myself, I don't really know the history, I just
remember being confused by it once in the past.

-- 
greg


On 16/02/11 15:59, Greg Stark wrote:
> On Wed, Feb 16, 2011 at 2:43 AM, Mark Kirkwood
> <mark.kirkwood@catalyst.net.nz>  wrote:
>> What's this libbsd then eh? Sure enough it is this guy that defines these
>> symbols. So it is the way it is being built on the Ubuntu (or Debian)
>> platform.
> Oh, for what it's worth there are several different libedits out there
> with various related heritages. It's possible you're looking at two
> completely different packages.
>
> On Debian /usr/share/doc/<package>/README.Debian is supposed to say
> where the upstream source was.
>

Yeah, good point:

$ dpkg -S /usr/lib/libedit.so.2
libedit2: /usr/lib/libedit.so.2

$ aptitude show libedit2
Package: libedit2
State: installed
Automatically installed: no
Version: 2.11-20080614-1build1
Priority: standard
Section: libs
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Uncompressed Size: 201k
Depends: libbsd0 (>= 0.0), libc6 (>= 2.11), libncurses5 (>= 5.6+20071006-3)
Description: BSD editline and history libraries The editline library provides generic line editing and history
functions.
 It slightly resembles GNU readline
Homepage: 
http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-5-0/src/lib/libedit/