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

Lists: pgsql-hackers
From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 01:46:02
Message-ID: 4D5B2C5A.8090506@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 01:54:45
Message-ID: 875.1297821285@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)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


From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 02:05:42
Message-ID: 4D5B30F6.1030803@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.


From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 02:43:08
Message-ID: 4D5B39BC.1030308@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 02:59:11
Message-ID: AANLkTi=-_+oU9qF_Zh5dbtCqBS_4h2SsN5c8r4n559eB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Feb 16, 2011 at 2:43 AM, Mark Kirkwood
<mark(dot)kirkwood(at)catalyst(dot)net(dot)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


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 03:02:13
Message-ID: AANLkTikn6-=qO3Y3+cDbGjOEFwNc5NNLpCtbjeMHeuyN@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: 9.1 (git head) does not compile using --with-libedit-preferred on Ubuntu 10.10
Date: 2011-02-16 03:04:43
Message-ID: 4D5B3ECB.7010209@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 16/02/11 15:59, Greg Stark wrote:
> On Wed, Feb 16, 2011 at 2:43 AM, Mark Kirkwood
> <mark(dot)kirkwood(at)catalyst(dot)net(dot)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(at)lists(dot)ubuntu(dot)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/