All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] Centralize checking for adequate version of gcc.
@ 2007-06-15 10:52 Robert P. J. Day
  2007-06-15 13:43 ` Vegard Nossum
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Robert P. J. Day @ 2007-06-15 10:52 UTC (permalink / raw)
  To: kernel-janitors


  here's a patch i submitted to andrew to centralize checking for a
proper version of gcc when building the kernel, but andrew claims it
broke the build.  i'm trying to reproduce the problem, and i'd
appreciate it if anyone else wants to apply this patch and try a build
based on "allyesconfig" or "allmodconfig" on x86 to see if they run
into some kind of issue, cuz i'm just not seeing it here.  thanks.

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 8287a72..50558f7 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -36,12 +36,20 @@ extern void __chk_io_ptr(const void __iomem *);

 #ifdef __KERNEL__

-#if __GNUC__ >= 4
+/*
+ *  Start with some sanity checking on the version of gcc.
+ */
+
+#if (__GNUC__ < 3) || (__GNUC__ = 3 && __GNUC_MINOR__ < 2)
+# error Sorry, your GCC is too old. It builds incorrect kernels.
+#elif __GNUC__ = 4 && __GNUC_MINOR__ = 1 && __GNUC_PATCHLEVEL__ = 0
+# warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
+#elif __GNUC__ = 4
 # include <linux/compiler-gcc4.h>
-#elif __GNUC__ = 3 && __GNUC_MINOR__ >= 2
+#elif __GNUC__ = 3
 # include <linux/compiler-gcc3.h>
 #else
-# error Sorry, your compiler is too old/not recognized.
+# error Sorry, your compiler is not recognized.
 #endif

 /* Intel compiler defines __GNUC__. So we will overwrite implementations
diff --git a/init/main.c b/init/main.c
index eb8bdba..db39a80 100644
--- a/init/main.c
+++ b/init/main.c
@@ -5,7 +5,6 @@
  *
  *  GK 2/5/95  -  Changed to support mounting root fs via NFS
  *  Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96
- *  Moan early if gcc is old, avoiding bogus kernels - Paul Gortmaker, May '96
  *  Simplified starting of init:  Michael A. Griffith <grif@acm.org>
  */

@@ -66,23 +65,6 @@
 #include <asm/smp.h>
 #endif

-/*
- * This is one of the first .c files built. Error out early if we have compiler
- * trouble.
- *
- * Versions of gcc older than that listed below may actually compile and link
- * okay, but the end product can have subtle run time bugs.  To avoid associated
- * bogus bug reports, we flatly refuse to compile with a gcc that is known to be
- * too old from the very beginning.
- */
-#if (__GNUC__ < 3) || (__GNUC__ = 3 && __GNUC_MINOR__ < 2)
-#error Sorry, your GCC is too old. It builds incorrect kernels.
-#endif
-
-#if __GNUC__ = 4 && __GNUC_MINOR__ = 1 && __GNUC_PATCHLEVEL__ = 0
-#warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler version is recommended.
-#endif
-
 static int kernel_init(void *);

 extern void init_IRQ(void);

-- 
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
====================================
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-06-22 19:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-15 10:52 [KJ] [PATCH] Centralize checking for adequate version of gcc Robert P. J. Day
2007-06-15 13:43 ` Vegard Nossum
2007-06-15 15:42 ` Robert P. J. Day
2007-06-15 15:57 ` Vegard Nossum
2007-06-15 15:57 ` Jaco Kroon
2007-06-15 16:39 ` Robert P. J. Day
2007-06-15 16:47 ` Jaco Kroon
2007-06-15 17:12 ` burns.ethan
2007-06-15 18:39 ` Robert P. J. Day
2007-06-20 21:38 ` Adrian Bunk
2007-06-20 21:53 ` Matthew Wilcox
2007-06-20 22:07 ` Robert P. J. Day
2007-06-21  5:19 ` Jaco Kroon
2007-06-21 12:00 ` Robert P. J. Day
2007-06-21 13:46 ` Alexey Dobriyan
2007-06-21 16:04 ` Robert P. J. Day
2007-06-21 18:37 ` Alexey Dobriyan
2007-06-22 19:29 ` Thomas De Schampheleire

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.