Re: 9.1.1 build failure : postgres link fails - Mailing list pgsql-general

From Tom Lane
Subject Re: 9.1.1 build failure : postgres link fails
Date
Msg-id 14054.1321806297@sss.pgh.pa.us
Whole thread Raw
In response to 9.1.1 build failure : postgres link fails  (Rob Sargentg <robjsargent@gmail.com>)
Responses Re: 9.1.1 build failure : postgres link fails  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-general
Rob Sargentg <robjsargent@gmail.com> writes:
> I just got round to updating my laptop to ubuntu-10.4 (32bit), in part
> because I kept hitting snags while trying to configure postgres 9.1.1.
> ubuntu-10.4 is not the latest of course and comes with gnu make 3.8.1,
> but it seems to compile everything then fails to link postgres executable:

> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wformat-security
> -fno-strict-aliasing -fwrapv -L../../src/port -Wl,--as-needed
> -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags  -Wl,-E <<TONS OF
> DOT OHs>> ../../src/port/libpgport_srv.a -lxslt -lxml2 -lssl -lcrypto
> -lcrypt -ldl -lm -lldap -o postgres
> postmaster/postmaster.o: In function `PostmasterMain':
> postmaster.c:(.text+0x48d7): undefined reference to `optreset'
> tcop/postgres.o: In function `process_postgres_switches':
> postgres.c:(.text+0x1312): undefined reference to `optreset'
> utils/misc/ps_status.o: In function `set_ps_display':
> ps_status.c:(.text+0xd4): undefined reference to `setproctitle'
> collect2: ld returned 1 exit status

There's a similar report in the archives:
http://archives.postgresql.org/pgsql-hackers/2011-02/msg01474.php

It appears that on Ubuntu, libbsd defines those symbols, which confuses
configure into supposing that they're provided by libc, and then the
link fails because libbsd isn't actually linked into the postmaster.
The question is what's pulling in libbsd though.  In the previous report
it came via libedit, which you're not using.  I'd try looking in the
config.log file to see what it was linking in the test that decided
setproctitle was available, and then using ldd on each of those
libraries to see which one(s) require libbsd.

            regards, tom lane

pgsql-general by date:

Previous
From: David Johnston
Date:
Subject: Re: Table Design question for gurus (without going to "NoSQL")...
Next
From: Rob Sargent
Date:
Subject: Re: 9.1.1 build failure : postgres link fails