* [Bug other/63699] bootstrap fails with Apple clang 6.0
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
@ 2014-10-31 13:30 ` howarth at bromo dot med.uc.edu
2014-11-05 5:47 ` andreast at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-10-31 13:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
--- Comment #1 from howarth at bromo dot med.uc.edu ---
Created attachment 33854
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33854&action=edit
proposed fix for compilation error against clang 6.0 compilers
The attached patch resolves the bootstrap compilation error on
x86_64-apple-darwin14 against the clang 6.0 (3.5svn) compilers.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug other/63699] bootstrap fails with Apple clang 6.0
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
2014-10-31 13:30 ` [Bug other/63699] " howarth at bromo dot med.uc.edu
@ 2014-11-05 5:47 ` andreast at gcc dot gnu.org
2014-11-07 8:42 ` fxcoudert at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: andreast at gcc dot gnu.org @ 2014-11-05 5:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
Andreas Tobler <andreast at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andreast at gcc dot gnu.org
--- Comment #2 from Andreas Tobler <andreast at gcc dot gnu.org> ---
Cross compilation with clang is also affected.
amd64-*-freebsd* -> arm-*-freebsd* fails with the same error.
The snippet attached to this report 'solves' the issue for me. Thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug other/63699] bootstrap fails with Apple clang 6.0
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
2014-10-31 13:30 ` [Bug other/63699] " howarth at bromo dot med.uc.edu
2014-11-05 5:47 ` andreast at gcc dot gnu.org
@ 2014-11-07 8:42 ` fxcoudert at gcc dot gnu.org
2014-11-07 8:43 ` [Bug bootstrap/63699] " fxcoudert at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-07 8:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu.org
--- Comment #3 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
A minimal testcase for this is:
#include "safe-ctype.h"
#include <string>
with the safe-ctype.h from trunk. Apparently, the C++ header <string> uses the
type functions, which are poisoned by GCC's safe-ctype.h header. The proper
fix, in my opinion, is to include <string> before "safe-ctype.h", which is
itself included in gcc/system.h.
The same logic already appears in go/go-system.h, which says:
// We don't really need iostream, but some versions of gmp.h include
// it when compiled with C++, which means that we need to include it
// before the macro magic of safe-ctype.h, which is included by
// system.h.
Here's the suggested patch, which I can't test right now unfortunately. Feel
free to submit it for review:
Index: plugin.cc
===================================================================
--- plugin.cc (revision 217000)
+++ plugin.cc (working copy)
@@ -31,6 +31,8 @@
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
+#include <string>
+
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"
@@ -55,8 +57,6 @@
#include "connection.hh"
#include "rpc.hh"
-#include <string>
-
#ifdef __GNUC__
#pragma GCC visibility push(default)
#endif
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63699] bootstrap fails with Apple clang 6.0
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
` (2 preceding siblings ...)
2014-11-07 8:42 ` fxcoudert at gcc dot gnu.org
@ 2014-11-07 8:43 ` fxcoudert at gcc dot gnu.org
2014-11-07 8:46 ` [Bug bootstrap/63699] Bootstrap fails in libcc1 on darwin14 fxcoudert at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-07 8:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-11-07
Component|other |bootstrap
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63699] Bootstrap fails in libcc1 on darwin14
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
` (3 preceding siblings ...)
2014-11-07 8:43 ` [Bug bootstrap/63699] " fxcoudert at gcc dot gnu.org
@ 2014-11-07 8:46 ` fxcoudert at gcc dot gnu.org
2014-11-09 20:35 ` howarth at bromo dot med.uc.edu
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-07 8:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|bootstrap fails with Apple |Bootstrap fails in libcc1
|clang 6.0 |on darwin14
--- Comment #4 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Also, it's not a clang vs. GCC issue: the trigger is the (legitimate, as far as
I know) use of ctype macros in C++ header <string>.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63699] Bootstrap fails in libcc1 on darwin14
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
` (4 preceding siblings ...)
2014-11-07 8:46 ` [Bug bootstrap/63699] Bootstrap fails in libcc1 on darwin14 fxcoudert at gcc dot gnu.org
@ 2014-11-09 20:35 ` howarth at bromo dot med.uc.edu
2014-11-11 9:20 ` fxcoudert at gcc dot gnu.org
2014-11-11 9:21 ` fxcoudert at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: howarth at bromo dot med.uc.edu @ 2014-11-09 20:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
--- Comment #5 from howarth at bromo dot med.uc.edu ---
Posted patch at https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00662.html.
Note that the alternate approach of modifying gcc/system.h to include <string>
conditionally on __cplusplus before "safe-ctype.h" causes bootstrap breakage
elsewhere on darwin.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63699] Bootstrap fails in libcc1 on darwin14
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
` (5 preceding siblings ...)
2014-11-09 20:35 ` howarth at bromo dot med.uc.edu
@ 2014-11-11 9:20 ` fxcoudert at gcc dot gnu.org
2014-11-11 9:21 ` fxcoudert at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-11 9:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
--- Comment #6 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Author: fxcoudert
Date: Tue Nov 11 09:20:07 2014
New Revision: 217342
URL: https://gcc.gnu.org/viewcvs?rev=217342&root=gcc&view=rev
Log:
PR bootstrap/63699
PR bootstrap/63750
* system.h: Include <string> before "safe-ctype.h"
* wide-int.h (wi::smin, wi::smax, wi::umin, wi::umax): Prefix
calls to min/max with wi namespace.
* ipa-chkp.c: Don't include <string>.
* plugin.cc: Don't include <string>.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-chkp.c
trunk/gcc/system.h
trunk/gcc/wide-int.h
trunk/libcc1/ChangeLog
trunk/libcc1/plugin.cc
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug bootstrap/63699] Bootstrap fails in libcc1 on darwin14
2014-10-31 12:56 [Bug other/63699] New: bootstrap fails with Apple clang 6.0 howarth at bromo dot med.uc.edu
` (6 preceding siblings ...)
2014-11-11 9:20 ` fxcoudert at gcc dot gnu.org
@ 2014-11-11 9:21 ` fxcoudert at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-11 9:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63699
Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |5.0
--- Comment #7 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread