From: chris@chrullrich.net
To: pgsql-bugs@postgresql.org
Subject: BUG #6732: Build issue when using gettext on FreeBSD 9
Date: Thu, 12 Jul 2012 15:25:35 +0000
Message-ID: <E1SpLGp-0004cp-1w@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 6732
Logged by: Christian Ullrich
Email address: chris@chrullrich.net
PostgreSQL version: 9.1.4
Operating system: FreeBSD 9
Description:
PostgreSQL 9.1 does not build on FreeBSD 9 if --enable-nls and a Heimdal
Kerberos build from ports is used. The build fails due to undefined
references to functions from gettext's libintl.
The reason is a combination of an oversight in PostgreSQL and the choice of
system linker in FreeBSD 9, which is GNU ld 2.17.50.
(It is nevertheless a PostgreSQL issue, not a FreeBSD one. Bear with me for
a minute.)
The PostgreSQL configure script indiscriminately enables the --as-needed
option to the linker if the linker supports it, which GNU ld 2.17.50 in
FreeBSD 9 does. It does not, however, use it in its own library checks. The
configure script therefore fails to detect libintl as required; the check
program links correctly because libintl is pulled in as an indirect
dependency via libgssapi.
There have been two relevant changes in the behavior of GNU ld since version
2.14, which was included in FreeBSD 8:
- Version 2.15 added the --as-needed flag
- Version 2.16 added the --add-needed flag (which was renamed to
--copy-dt-needed-entries in 2.21 and had its default inverted in 2.22)
With GNU ld 2.14 on FreeBSD 8, the build used to succeed because the
dependency on libintl from libgssapi was sufficient. With the first change
in behavior, the build with GNU ld 2.17 on FreeBSD 9 fails because the
configuration check picks up libintl through libgssapi, but in the failing
location (there are several, the first one to be hit is ecpg, but initdb is
affected as well) libgssapi is dropped due to --as-needed and cannot
contribute its dependency on libintl.
With the current version, GNU ld 2.22, the build works again, because the
second change in behavior allows the configure script to detect the need for
libintl, which is then used wherever required.
Proposed workaround: Do not use --as-needed at all.
Proposed fix: Use --as-needed during configure as well, or make its use
predicated on a working linker version (GNU ld 2.22 or later).
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: chris@chrullrich.net
Subject: Re: BUG #6732: Build issue when using gettext on FreeBSD 9
In-Reply-To: <E1SpLGp-0004cp-1w@wrigleys.postgresql.org>
References: <E1SpLGp-0004cp-1w@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox