This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
cpplib and iconv.h (bootstrap failure)
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Zack Weinberg <zack at codesourcery dot com>,Neil Booth <neil at daikokuya dot co dot uk>, Dave Brolley <brolley at redhat dot com>,Per Bothner <per at bothner dot com>
- Cc: gcc at gcc dot gnu dot org, David O'Brien <obrien at freebsd dot org>,Loren James Rittle <rittle at labs dot mot dot com>
- Date: Sun, 16 Nov 2003 14:24:38 +0100 (CET)
- Subject: cpplib and iconv.h (bootstrap failure)
This weekend I finally had time to investigate why GCC mainline has
been failing to bootstrap on some systems for quite some time.
Assume libiconv is present in /usr/local/lib, and iconv.h is in
/usr/local/include. Furthermore assume that the bootstrapping compiler
does not have /usr/local/include in its include search path.
In that case, gcc/configure will proceed as follows
checking for iconv... yes
checking how to link with libiconv... /usr/local/lib/libiconv.so -rpath /usr/local/lib
and we will then stumble over a bug in gcc/cpphash.h:
#ifdef HAVE_ICONV
#include <iconv.h>
#else
#define HAVE_ICONV 0
typedef int iconv_t; /* dummy */
#endif
This code incorrectly assumes that HAVE_ICONV also implies that iconv.h
is in the include search path, which is not what our configure machinery
actually checks:
/* Define if you have the iconv() function. */
/* #undef HAVE_ICONV */
As far as I can see, this is a GCC bug and we should introduce
HAVE_ICONV_H using AC_CHECK_HEADERS() and check for that before
including <iconv.h>.
I currently cannot properly develop/test patches; would one of you mind
having a look?
Gerald
--
Gerald Pfeifer (Jerry) gerald@pfeifer.com http://www.pfeifer.com/gerald/