Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Bram Moolenaar <Bram <at> moolenaar.net>
Subject: [PATCH] configure: use minimal LIBS during gettext check
Newsgroups: gmane.editors.vim.devel
Date: Sunday 17th November 2013 19:38:56 UTC (over 4 years ago)
Thomas De Schampheleire wrote:

> In some configurations, vim fails to link correctly with messages such
as:
> edit.c:(.text+0x1614): undefined reference to `libintl_gettext'
> 
> In particular, this has been seen by the buildroot autobuilds (see [1])
but
> has also been reported at [2] and [3].
> 
> In the bad case, the configure script says:
> checking for NLS... gettext() works
> In the good case, it says:
> checking for NLS... gettext() works with -lintl
> 
> In the bad case, the system has libelf, vim detects that and takes it
along
> in $LIBS. Libelf needs libintl on this system, and so linking the test
> program with -lelf will automatically take -lintl too. This causes
configure
> to think gettext() does not need libintl, while in reality it does.
> 
> In the good case, libelf is not present and thus not used. The first
> configure test for gettext fails, and then configure retries with -lintl
> (which succeeds).
> 
> Until now, there isn't really a problem. In both cases, you could link
> correctly. In the 'bad' case, libintl is implicitly taken through libelf,
in
> the second case it is explicitly taken.
> 
> The real problem occurs because configure also tests whether the linker
> supports --as-needed and uses it when possible, instead of the link.sh
> script. However, --as-needed seems to cause libintl NOT to be taken in
the
> bad case, causing the undefined references to libintl_gettext.
> 
> This patch changes the configure script so that the gettext check does
not
> use additional libraries such as libelf. The test program is linked
either
> with nothing, or with libintl alone. This will cause libintl to
> be added explicitly to LIBS, when needed.
> 
> [1] http://autobuild.buildroot.net/results/21b5a910e6a27fa1cb12d0002ffed7e6ed9d6c83/
> [2] http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2012-November/243930.html
> [3] http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2012-May/234184.html

Thanks for the clear explanation and the patch.  I'll include it.

-- 
Eye have a spelling checker, it came with my PC;
It plainly marks four my revue mistakes I cannot sea.
I've run this poem threw it, I'm sure your please to no,
It's letter perfect in it's weigh, my checker tolled me sew!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net
  \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org       
///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org  
 ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected]
For more options, visit https://groups.google.com/groups/opt_out.
 
CD: 4ms