This is the mail archive of the gcc-patches@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]

possible Linux bootstrap problem possible fix


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
fixed.
-- 
- 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)
+#ifdef NO_C99_INLINE_ON_THIS_SYSTEM
 	  DECL_EXTERNAL (decl) = (storage_class == csc_extern) == !flag_isoc99;
+#else
+	  DECL_EXTERNAL (decl) = (storage_class == csc_extern);
+#endif
 	else
 	  DECL_EXTERNAL (decl) = !initialized;
 
Index: config/linux.h
===================================================================
--- config/linux.h	(revision 118342)
+++ config/linux.h	(working copy)
@@ -127,3 +127,5 @@
 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
 
 #define TARGET_POSIX_IO
+
+#define NO_C99_INLINE_ON_THIS_SYSTEM
============================================================


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