Re: and setproctitle/optreset problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: and setproctitle/optreset problem
Date: 2012-12-18 02:44:14
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Christoph Berg <christoph(dot)berg(at)credativ(dot)de> writes:
> We are regularly teaching PostgreSQL courses at
> Starting from the course in November, PG doesn't compile anymore on
> their default Debian Squeeze install laptops they hand out to the
> participants. After ./configure && make, the error looks like this:

> postmaster/postmaster.o: In function `PostmasterMain':
> postmaster.c:(.text+0x40e2): undefined reference to `optreset'
> tcop/postgres.o: In function `process_postgres_switches':
> postgres.c:(.text+0x168c): undefined reference to `optreset'
> utils/misc/ps_status.o: In function `set_ps_display':
> ps_status.c:(.text+0xba): undefined reference to `setproctitle'
> collect2: error: ld returned 1 exit status
> make[2]: *** [postgres] Fehler 1
> make[2]: Leaving directory `/home/cbe/projects/postgresql/postgresql/src/backend'

> This is 9.2.2, but I've seen 9.1.6 failing in the same way. The
> package set installed is a desktop install, plus what Debian
> considers to be build dependencies of postgresql-9.2, that is,
> libedit-dev is installed, but libreadline-dev isn't.

I installed Debian for the first time in a long time, and verified that
their version of libedit exposes bogus definitions of setproctitle,
optreset, and god knows what else.

> already contains a workaround for -ledit containing a
> strlcpy() version, so I'd propose the attached patch to extend that
> workaround to setproctitle. (Patch for 9.2's, but the
> same moving of the two code blocks should work for head as well.)

I think we should assume that the libedit developers are utterly
clueless about not trampling on application namespace, and just cut
that library out of *all* our link checks except for the symbols we
specifically expect to get from libedit/libreadline. Hence, I propose
the attached slightly more extensive patch. I've verified that this
produces a working build with Debian's libedit.

regards, tom lane

Attachment Content-Type Size
libedit-defenses.patch text/x-patch 2.7 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-12-18 03:05:53 Re: and setproctitle/optreset problem
Previous Message Bruce Momjian 2012-12-18 02:21:59 Re: [GENERAL] trouble with pg_upgrade 9.0 -> 9.1