With --disable-nls intl.h does #ifdef ENABLE_NLS #include <libintl.h> extern void gcc_init_libintl (void); extern size_t gcc_gettext_width (const char *); #else /* Stubs. */ # undef textdomain # define textdomain(domain) (domain) # undef bindtextdomain # define bindtextdomain(domain, directory) (domain) # undef gettext # define gettext(msgid) (msgid) which wrecks an included libintl.h: extern char *(__const char *__msgid) throw () __attribute__ ((__format_arg__ (1))); and g++ rightfully complains. We end up including libintl.h through gcc/double-int.h #include <gmp.h> #include <iosfwd> (here from GCC 4.1) #include <bits/c++locale.h> #include <libintl.h>
Diego / Ian, can any of you try to fix this? Possibly by looking for and including libintl.h before re-defining those macros? It's the toplevel intl.h btw. Broke all our autotesters ...
Another fix is to include all system headers (and thus gmp.h) from system.h which always comes before includes of intl.h.
Fails with a 4.1 host libstdc++, succeeds with a 4.6 host libstdc++.
Tentative fix: http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01046.html Don't have an old enough compiler to test it myself. Need help with testing.
Author: dnovillo Date: Thu Aug 16 13:28:13 2012 New Revision: 190444 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190444 Log: 2012-08-16 Diego Novillo <dnovillo@google.com> PR bootstrap/54281 * double-int.h: Move including of gmp.h ... * system.h: ... here. * realmpfr.h: Do not include gmp.h. * tree-ssa-loop-niter.c: Do not include gmp.h. fortran/ChangeLog * gfortran.h: Do not include gmp.h. Modified: trunk/gcc/ChangeLog trunk/gcc/double-int.h trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/gfortran.h trunk/gcc/realmpfr.h trunk/gcc/system.h trunk/gcc/tree-ssa-loop-niter.c
Fixed at rev 190444.
Mi fix broke Ada and in-tree cloog/isl. I will revert and fix it without the system.h modification.
Author: dnovillo Date: Thu Aug 16 18:24:22 2012 New Revision: 190449 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190449 Log: 2012-08-16 Diego Novillo <dnovillo@google.com> Revert PR bootstrap/54281 * double-int.h: Move including of gmp.h ... * system.h: ... here. * realmpfr.h: Do not include gmp.h. * tree-ssa-loop-niter.c: Do not include gmp.h. Modified: trunk/gcc/ChangeLog trunk/gcc/double-int.h trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/gfortran.h trunk/gcc/realmpfr.h trunk/gcc/system.h trunk/gcc/tree-ssa-loop-niter.c
New proposed patch. Needs testing with a 4.1 compiler. I couldn't build my own (fails to build). http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01090.html
Author: dnovillo Date: Fri Aug 17 15:37:57 2012 New Revision: 190487 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190487 Log: 2012-08-17 Diego Novillo <dnovillo@google.com> PR bootstrap/54281 * configure.ac: Add libintl.h to AC_CHECK_HEADERS list. * config.in: Regenerate. * configure: Regenerate. * intl.h: Always include libintl.h if HAVE_LIBINTL_H is set. Modified: trunk/gcc/ChangeLog trunk/gcc/config.in trunk/gcc/configure trunk/gcc/configure.ac trunk/gcc/intl.h
Fixed. http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01181.html
.
This patch kind of caused PR bootstrap/54281.
(In reply to comment #13) > This patch kind of caused PR bootstrap/54281. [which is this PR ...] I meant another PR, namely PR bootstrap/54659.