possible Linux bootstrap problem possible fix

Geoffrey Keating gkeating@apple.com
Wed Nov 1 06:30:00 GMT 2006

Andrew claims that there is a GCC bootstrap problem on Linux because
some parts of GCC build with -std=c99 and the Linux headers are not
compatible with C99.

If so, and if it's felt that this is an urgent problem, I propose this
patch.  I have no availability of any Linux box for testing it, so I
won't apply it until it's confirmed that (a) the problem exists and
(b) this fixes it.  Feel free to apply it yourself if you have
confirmed this.

The effect of this patch is that with -std=c99, all non-Linux
platforms will have ISO C99 semantics, but Linux platforms will
exchange the meaning of 'inline' and 'extern inline'.  (Other C99
rules still apply.)  I'd expect that the Linux maintainers would
consider this to be a temporary solution until the headers can be
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-stupidlinuxheaders.patch==============
2006-10-31  Geoffrey Keating  <geoffk@apple.com>

	* c-decl.c (grokdeclarator) [NO_C99_INLINE_ON_THIS_SYSTEM]: Don't
	handle C99 inline semantics.
	* config/linux.h (NO_C99_INLINE_ON_THIS_SYSTEM): Define.

Index: c-decl.c
--- c-decl.c	(revision 118356)
+++ c-decl.c	(working copy)
@@ -4772,7 +4772,11 @@
 	   in this file, C99 6.7.4p6.  In GNU C89, a function declared
 	   'extern inline' is an external reference.  */
 	else if (declspecs->inline_p && storage_class != csc_static)
 	  DECL_EXTERNAL (decl) = (storage_class == csc_extern) == !flag_isoc99;
+	  DECL_EXTERNAL (decl) = (storage_class == csc_extern);
 	  DECL_EXTERNAL (decl) = !initialized;
Index: config/linux.h
--- config/linux.h	(revision 118342)
+++ config/linux.h	(working copy)
@@ -127,3 +127,5 @@

More information about the Gcc-patches mailing list