This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]