After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 388789 - Subtle bug in autotools checks for iconv
Subtle bug in autotools checks for iconv
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
2.10.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 428375 428399 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-22 23:46 UTC by Elijah Newren
Modified: 2013-09-13 00:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Change AC_TRY_LINK to AC_TRY_RUN for step 2 (898 bytes, patch)
2006-12-22 23:47 UTC, Elijah Newren
committed Details | Review
Trivial fix to the bug in the previous patch pointed out by Eric (369 bytes, patch)
2007-04-11 21:02 UTC, Elijah Newren
committed Details | Review

Description Elijah Newren 2006-12-22 23:46:24 UTC
I'm guessing I'm the only one in the universe with a system weird enough to
trigger this build bug:

configure.in does three things in regards to iconv:
  1) Check for any special --with-libiconv flag, setting $ICONV_CFLAGS and
     $ICONV_LIBS if found
  2) Check if a program can *link* (which implies compile as well, I guess)
     against -liconv, adding -liconv to $ICONV_LIBS if so
  3) Checks to see if a simple program can compile, link, AND run with the
     above determined ICONV_CFLAGS and ICONV_LIBS

I think the logic from 2->3 is buggy; -liconv should only be added to
ICONV_LIBS if a program can compile, link, *and run* against -liconv.  The
patch to fix this is trivial; I'll attach it in a minute.  With the patch (and
a similar one for evolution-data-server; see bug 388788), everything builds and functions well for me.
Comment 1 Elijah Newren 2006-12-22 23:47:04 UTC
Created attachment 78821 [details] [review]
Change AC_TRY_LINK to AC_TRY_RUN for step 2
Comment 2 Matthew Barnes 2007-03-27 00:09:12 UTC
Patch committed to Subversion trunk, revision 33323.  Thanks Elijah!
Comment 3 Elijah Newren 2007-04-04 17:31:08 UTC
Any chance we could also get this on the gnome-2-18 branch?
Comment 4 Matthew Barnes 2007-04-04 18:59:18 UTC
Sure thing.  I'll get bug #388788, too.

Committed to gnome-2-18 branch (revision 33383).
Comment 5 Elijah Newren 2007-04-04 19:03:34 UTC
Thanks!
Comment 6 André Klapper 2007-04-11 19:51:25 UTC
*** Bug 428375 has been marked as a duplicate of this bug. ***
Comment 7 André Klapper 2007-04-11 19:51:36 UTC
copying Eric's comment from bug 428375:

While trying to track down yet another use-before-initialize bug in evo, I
decided to update to evolution-data-server 1.10.1 hoping it was already fixed. 
However, that version fails at configure in the iconv test.  The code does:

AC_TRY_RUN([
#include <iconv.h>

int main (int argc, char **argv)
{
        iconv_t cd;
        cd = iconv_open ("UTF-8", "ISO-8859-1");
}
], ac_cv_libiconv=yes, ac_cv_libiconv=no, ac_cv_libiconv=no)

Checking the return code of a program which doesn't bother returning any value
from main() gets you all the results you expect.  Of course, doing a TRY_RUN
for just checking which library iconv_open() is in is dubious anyway.
Comment 8 Elijah Newren 2007-04-11 21:02:15 UTC
Created attachment 86201 [details] [review]
Trivial fix to the bug in the previous patch pointed out by Eric
Comment 9 Matthew Barnes 2007-04-12 00:29:02 UTC
Thanks.  Also added "#include <stdlib.h>" to the test program to make sure it plays nicely with -Werror-implicit-function-declaration.

Committed to trunk (revision #33420) and gnome-2-18 branch (revision #33421).
Comment 10 Ross Burton 2007-04-15 14:36:30 UTC
*** Bug 428399 has been marked as a duplicate of this bug. ***