Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id DD5FC55C5A4 for ; Mon, 16 Jul 2012 15:14:38 -0300 (ADT) Received: from mailout-de.gmx.net ([213.165.64.23]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Sqpoa-0005do-SB for pgsql-bugs@postgresql.org; Mon, 16 Jul 2012 18:14:38 +0000 Received: (qmail invoked by alias); 16 Jul 2012 18:13:19 -0000 Received: from a88-115-214-103.elisa-laajakaista.fi (EHLO [10.0.0.103]) [88.115.214.103] by mail.gmx.net (mp019) with SMTP; 16 Jul 2012 20:13:19 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX19C/sFe6t9Cvlh/iiDCsgwxFjanTTOvkgLx6t/Ezq +RLLXxRaApaRv+ Message-ID: <1342462398.7129.5.camel@vanquo.pezone.net> Subject: Re: BUG #6732: Build issue when using gettext on FreeBSD 9 From: Peter Eisentraut To: chris@chrullrich.net Cc: pgsql-bugs@postgresql.org Date: Mon, 16 Jul 2012 21:13:18 +0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/128 X-Sequence-Number: 33604 On tor, 2012-07-12 at 15:25 +0000, chris@chrullrich.net wrote: > 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. > 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). Over the weekend I was investigating a separate but related issue on Debian, which goes like this: configure with --with-libedit-preferred, or have libedit but not libreadline installed. Because libedit is linked with libbsd, which provides setproctitle, the check for function setproctitle succeeds. Thus, ps_status.c is compiled using the setproctitle variant. When postgres is linked, however, we don't put libedit on the command line, so the link fails. The workaround/solution I came up with was also to put LDFLAGS=-Wl,--as-needed on the configure command line to run the tests with that flag as well. With that, the setproctitle test fails. To add insult to injury, the setproctitle implementation in libbsd is a stub that doesn't do anything, so we definitely don't want to arrive at a solution that ends up using it.