Skip to contentSkip to conversation

document that gcc 4 is not supported

PATCH In review Adrian Bunk 2 participants 3 messages Jan 6, 2006 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 document that gcc 4 is not supported

gcc 4 is not supported for compiling kernel 2.4, and I don't see any compelling reason why kernel 2.4 should ever be adapted to gcc 4.

This patch documents this fact.

Without this patch, your screen is flooded with warnings and errors when accidentially trying to compile kernel 2.4 with gcc 4.

With this patch, the same happens, but the last lines contain the explanation
#error Sorry, your GCC is too recent for kernel 2.4

If someone makes a patch to fix all issues with gcc 4, adding the removal of this #error should be the most trivial part of the patch.

---

 Documentation/Changes |    2 ++
 README                |    1 +
 init/main.c           |    7 +++++++
 3 files changed, 10 insertions(+)
init/main.c renamed from init/main.c.old +7 -0
@@ -84,6 +84,13 @@
 #error Sorry, your GCC is too old. It builds incorrect kernels.
 #endif
 
+/*
+ * gcc >= 4 is not supported by kernel 2.4
+ */
+#if __GNUC__ > 3
+#error Sorry, your GCC is too recent for kernel 2.4
+#endif
+
 extern char _stext, _etext;
 extern char *linux_banner;
 
README renamed from README.old +1 -0
@@ -152,6 +152,7 @@
 
  - Make sure you have gcc 2.95.3 available.  gcc 2.91.66 (egcs-1.1.2) may
    also work but is not as safe, and *gcc 2.7.2.3 is no longer supported*.
+   gcc 4 is *not* supported.
    Also remember to upgrade your binutils package (for as/ld/nm and company)
    if necessary. For more information, refer to ./Documentation/Changes.
 
Documentation/Changes renamed from Documentation/Changes.old +2 -0
@@ -91,6 +91,8 @@
 You should ensure you use gcc-2.96-74 or later. gcc-2.96-54 will not build
 the kernel correctly.
 
+gcc 4 is not supported.
+
 In addition, please pay attention to compiler optimization.  Anything
 greater than -O2 may not be wise.  Similarly, if you choose to use gcc-2.95.x
 or derivatives, be sure not to use -fstrict-aliasing (which, depending on
#1 lore raw

Hi Adrian,

Quoted 11 lines · Adrian Bunk

gcc 4 is not supported for compiling kernel 2.4, and I don't see any compelling reason why kernel 2.4 should ever be adapted to gcc 4.

This patch documents this fact.

Without this patch, your screen is flooded with warnings and errors when accidentially trying to compile kernel 2.4 with gcc 4.

With this patch, the same happens, but the last lines contain the explanation
#error Sorry, your GCC is too recent for kernel 2.4

Well, why not putting this into include/linux/compiler.h instead ? It would shout earlier and will be easier to find.

Quoted 32 lines

If someone makes a patch to fix all issues with gcc 4, adding the removal of this #error should be the most trivial part of the patch.

---

 Documentation/Changes |    2 ++
 README                |    1 +
 init/main.c           |    7 +++++++
 3 files changed, 10 insertions(+)
init/main.c renamed from init/main.c.old +7 -0
@@ -84,6 +84,13 @@
 #error Sorry, your GCC is too old. It builds incorrect kernels.
 #endif
 
+/*
+ * gcc >= 4 is not supported by kernel 2.4
+ */
+#if __GNUC__ > 3
+#error Sorry, your GCC is too recent for kernel 2.4
+#endif
+
 extern char _stext, _etext;
 extern char *linux_banner;
 

README line 155

Quoted 4 lines
README renamed from README.old +1 -0
@@ -152,6 +152,7 @@
 
  - Make sure you have gcc 2.95.3 available.  gcc 2.91.66 (egcs-1.1.2) may
    also work but is not as safe, and *gcc 2.7.2.3 is no longer supported*.
+   gcc 4 is *not* supported.

I would even explicitly state that gcc-3.3 and 3.4 should work in most cases, while gcc 4 will definitely not work. It's important IMHO to give the answers that most users will be looking for, and 3.3/3.4 are fairly common.

Documentation/Changes line 95

Quoted 11 lines
README renamed from README.old +0 -0
    Also remember to upgrade your binutils package (for as/ld/nm and company)
    if necessary. For more information, refer to ./Documentation/Changes.
 
Documentation/Changes renamed from Documentation/Changes.old +2 -0
@@ -91,6 +91,8 @@
 You should ensure you use gcc-2.96-74 or later. gcc-2.96-54 will not build
 the kernel correctly.
 
+gcc 4 is not supported.
+

Same here.

Documentation/Changes line 98

Quoted 4 lines
Documentation/Changes renamed from Documentation/Changes.old +0 -0
 In addition, please pay attention to compiler optimization.  Anything
 greater than -O2 may not be wise.  Similarly, if you choose to use gcc-2.95.x
 or derivatives, be sure not to use -fstrict-aliasing (which, depending on

Thanks,
Willy

#2 lore raw
Quoted 11 lines · Willy Tarreau

Hi Adrian,

Quoted 8 lines · Adrian Bunk

gcc 4 is not supported for compiling kernel 2.4, and I don't see any compelling reason why kernel 2.4 should ever be adapted to gcc 4.

This patch documents this fact.

Without this patch, your screen is flooded with warnings and errors when accidentially trying to compile kernel 2.4 with gcc 4.

Quoted 7 lines
Quoted 3 lines

With this patch, the same happens, but the last lines contain the explanation
#error Sorry, your GCC is too recent for kernel 2.4

Well, why not putting this into include/linux/compiler.h instead ? It would shout earlier and will be easier to find.
...

init/main.c is the first file that gets compiled, and therefore the traditional place for such compiler checks.

Quoted 4 lines
Quoted 4 lines
README renamed from README.old +0 -0
@@ -152,6 +152,7 @@
 
Quoted 9 lines

README line 155

Quoted 3 lines
README renamed from README.old +1 -0
  - Make sure you have gcc 2.95.3 available.  gcc 2.91.66 (egcs-1.1.2) may
    also work but is not as safe, and *gcc 2.7.2.3 is no longer supported*.
+   gcc 4 is *not* supported.

I would even explicitly state that gcc-3.3 and 3.4 should work in most cases, while gcc 4 will definitely not work. It's important IMHO to give the answers that most users will be looking for, and 3.3/3.4 are fairly common.
...

gcc 2.95 is still the recommended compiler for kernel 2.4.

But if you want to improve the text, feel free to send a patch. :-)

Quoted 2 lines

Thanks,
Willy

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed