Bug 54281 - [4.8 Regression] Fails to bootstrap with --disable-nls
Summary: [4.8 Regression] Fails to bootstrap with --disable-nls
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2012-08-16 10:57 UTC by Richard Biener
Modified: 2012-09-24 19:43 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-08-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2012-08-16 10:57:46 UTC
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>
Comment 1 Richard Biener 2012-08-16 11:01:51 UTC
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 ...
Comment 2 Richard Biener 2012-08-16 11:18:42 UTC
Another fix is to include all system headers (and thus gmp.h) from system.h
which always comes before includes of intl.h.
Comment 3 Richard Biener 2012-08-16 11:22:06 UTC
Fails with a 4.1 host libstdc++, succeeds with a 4.6 host libstdc++.
Comment 4 Diego Novillo 2012-08-16 12:04:59 UTC
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.
Comment 5 Diego Novillo 2012-08-16 13:28:27 UTC
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
Comment 6 Diego Novillo 2012-08-16 13:30:22 UTC
Fixed at rev 190444.
Comment 7 Diego Novillo 2012-08-16 18:03:47 UTC
Mi fix broke Ada and in-tree cloog/isl.  I will revert and fix it without the system.h modification.
Comment 8 Diego Novillo 2012-08-16 18:24:30 UTC
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
Comment 9 Diego Novillo 2012-08-16 18:42:48 UTC
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
Comment 10 Diego Novillo 2012-08-17 15:38:03 UTC
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
Comment 11 Diego Novillo 2012-08-17 16:17:20 UTC
Fixed.  http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01181.html
Comment 12 Diego Novillo 2012-08-17 16:19:02 UTC
.
Comment 13 Tobias Burnus 2012-09-24 19:41:16 UTC
This patch kind of caused PR bootstrap/54281.
Comment 14 Tobias Burnus 2012-09-24 19:43:07 UTC
(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.