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

[PATCH] preparing 2.2.14 for gcc-3.0


Hi gang,

The gcc people are planning for the future release of 3.0. One of their
release criteria is that the Linux 2.2.14 kernel builds and works out of the
box. For more info, see:
    http://gcc.gnu.org/gcc-3.0/criteria.html

One problem to overcome is that __GNUC__ will change from 2 to 3, and there
are some broken tests in the current 2.2.14 kernel. The following patch fixes
all the ones I could find that appear to break.

I have also changed all the occurances of:

    #if __GNUC__ > 2 || __GNUC__ >= minor

to the preferred form of:

    #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= minor)

The former won't break with the transition to 3.0, but is bad because it may
encourage post-3.0 people to start using:

    #if __GNUC__ > 3 || __GNUC__ >= minor

which will cause minor versions of gcc-2.x to misbehave.

I haven't enabled the following missed optimisation opportunity which the
code says are broken in gcc 2.95 and later:
    drivers/isdn/isdn_audio.c:301

I think it would be extremely wise to make similar fixes to the 2.4 kernel
before it is released, as this will greatly reduce confusion when gcc-3.0
comes around.

diff -ur linux-2.2.14/arch/sparc64/kernel/sparc64_ksyms.c linux-2.2.14+GNUC/arch/sparc64/kernel/sparc64_ksyms.c
--- linux-2.2.14/arch/sparc64/kernel/sparc64_ksyms.c	Wed Oct 27 10:53:39 1999
+++ linux-2.2.14+GNUC/arch/sparc64/kernel/sparc64_ksyms.c	Thu Apr 27 12:56:14 2000
@@ -232,7 +232,7 @@
 /* sparc library symbols */
 EXPORT_SYMBOL(bcopy);
 EXPORT_SYMBOL(__strlen);
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 EXPORT_SYMBOL(strlen);
 #endif
 EXPORT_SYMBOL(strnlen);
Only in linux-2.2.14+GNUC: cscope.files
Only in linux-2.2.14+GNUC: cscope.out
diff -ur linux-2.2.14/include/asm-alpha/byteorder.h linux-2.2.14+GNUC/include/asm-alpha/byteorder.h
--- linux-2.2.14/include/asm-alpha/byteorder.h	Sun Jun  7 11:52:04 1998
+++ linux-2.2.14+GNUC/include/asm-alpha/byteorder.h	Thu Apr 27 12:29:48 2000
@@ -7,7 +7,7 @@
    with the standard macros.  And since it can schedule, it does even
    better in the end.  */
 
-#if defined(__GNUC__) && __GNUC_MINOR__ < 91
+#if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ < 91
 
 static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
 {
diff -ur linux-2.2.14/include/asm-alpha/compiler.h linux-2.2.14+GNUC/include/asm-alpha/compiler.h
--- linux-2.2.14/include/asm-alpha/compiler.h	Mon Aug 10 05:09:06 1998
+++ linux-2.2.14+GNUC/include/asm-alpha/compiler.h	Thu Apr 27 13:03:07 2000
@@ -13,7 +13,7 @@
  * EGCS (of varying versions) does a good job of using insxl and extxl.
  */
 
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 #define __kernel_insbl(val, shift) \
   (((unsigned long)(val) & 0xfful) << ((shift) * 8))
 #define __kernel_inswl(val, shift) \
@@ -29,7 +29,7 @@
      __kir; })
 #endif
 
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 92
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 92)
 #define __kernel_extbl(val, shift)  (((val) >> (((shift) & 7) * 8)) & 0xfful)
 #define __kernel_extwl(val, shift)  (((val) >> (((shift) & 7) * 8)) & 0xfffful)
 #else
diff -ur linux-2.2.14/include/asm-alpha/string.h linux-2.2.14+GNUC/include/asm-alpha/string.h
--- linux-2.2.14/include/asm-alpha/string.h	Mon Aug 10 05:09:06 1998
+++ linux-2.2.14+GNUC/include/asm-alpha/string.h	Thu Apr 27 13:03:47 2000
@@ -14,7 +14,7 @@
 /* For backward compatibility with modules.  Unused otherwise.  */
 extern void * __memcpy(void *, const void *, size_t);
 
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 #define memcpy __builtin_memcpy
 #endif
 
@@ -22,7 +22,7 @@
 extern void * __constant_c_memset(void *, unsigned long, size_t);
 extern void * __memset(void *, int, size_t);
 
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 #define memset(s, c, n)							    \
 (__builtin_constant_p(c)						    \
  ? (__builtin_constant_p(n) && (c) == 0					    \
diff -ur linux-2.2.14/include/asm-alpha/unaligned.h linux-2.2.14+GNUC/include/asm-alpha/unaligned.h
--- linux-2.2.14/include/asm-alpha/unaligned.h	Sun Jun  7 11:52:04 1998
+++ linux-2.2.14+GNUC/include/asm-alpha/unaligned.h	Thu Apr 27 13:08:14 2000
@@ -31,7 +31,7 @@
 
 extern inline unsigned long __uldq(const unsigned long * r11)
 {
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 	const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
 	return ptr->x;
 #else
@@ -50,7 +50,7 @@
 
 extern inline unsigned long __uldl(const unsigned int * r11)
 {
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 	const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
 	return ptr->x;
 #else
@@ -69,7 +69,7 @@
 
 extern inline unsigned long __uldw(const unsigned short * r11)
 {
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 	const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
 	return ptr->x;
 #else
@@ -92,7 +92,7 @@
 
 extern inline void __ustq(unsigned long r5, unsigned long * r11)
 {
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 	struct __una_u64 *ptr = (struct __una_u64 *) r11;
 	ptr->x = r5;
 #else
@@ -117,7 +117,7 @@
 
 extern inline void __ustl(unsigned long r5, unsigned int * r11)
 {
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 	struct __una_u32 *ptr = (struct __una_u32 *) r11;
 	ptr->x = r5;
 #else
@@ -142,7 +142,7 @@
 
 extern inline void __ustw(unsigned long r5, unsigned short * r11)
 {
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 	struct __una_u16 *ptr = (struct __una_u16 *) r11;
 	ptr->x = r5;
 #else
diff -ur linux-2.2.14/include/asm-mips/init.h linux-2.2.14+GNUC/include/asm-mips/init.h
--- linux-2.2.14/include/asm-mips/init.h	Tue Aug 10 05:04:41 1999
+++ linux-2.2.14+GNUC/include/asm-mips/init.h	Thu Apr 27 12:32:25 2000
@@ -15,7 +15,7 @@
 	__arginit __init; \
 	__arginit
 
-#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 8
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
 #define __initlocaldata  __initdata
 #else
 #define __initlocaldata
diff -ur linux-2.2.14/include/asm-ppc/byteorder.h linux-2.2.14+GNUC/include/asm-ppc/byteorder.h
--- linux-2.2.14/include/asm-ppc/byteorder.h	Thu Oct  1 03:14:33 1998
+++ linux-2.2.14+GNUC/include/asm-ppc/byteorder.h	Thu Apr 27 12:34:20 2000
@@ -38,7 +38,7 @@
 /* alas, egcs sounds like it has a bug in this code that doesn't use the
    inline asm correctly, and can cause file corruption. Until I hear that
    it's fixed, I can live without the extra speed. I hope. */
-#if !(__GNUC__ >= 2 && __GNUC_MINOR__ >= 90)
+#if !((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 90))
 #if 0
 #  define __arch_swab16(x) ld_le16(&x)
 #  define __arch_swab32(x) ld_le32(&x)
diff -ur linux-2.2.14/include/asm-ppc/init.h linux-2.2.14+GNUC/include/asm-ppc/init.h
--- linux-2.2.14/include/asm-ppc/init.h	Thu Dec 31 05:56:58 1998
+++ linux-2.2.14+GNUC/include/asm-ppc/init.h	Thu Apr 27 13:05:12 2000
@@ -1,7 +1,7 @@
 #ifndef _PPC_INIT_H
 #define _PPC_INIT_H
 
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 90 /* egcs */
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 90 /* egcs */
 #define __init __attribute__ ((__section__ (".text.init")))
 #define __initdata __attribute__ ((__section__ (".data.init")))
 #define __initfunc(__arginit) \
diff -ur linux-2.2.14/include/asm-sparc64/string.h linux-2.2.14+GNUC/include/asm-sparc64/string.h
--- linux-2.2.14/include/asm-sparc64/string.h	Wed Oct 28 04:52:21 1998
+++ linux-2.2.14+GNUC/include/asm-sparc64/string.h	Thu Apr 27 13:05:44 2000
@@ -113,7 +113,7 @@
 
 extern __kernel_size_t __strlen(const char *);
 
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 extern __kernel_size_t strlen(const char *);
 #else /* !EGCS */
 /* Ugly but it works around a bug in our original sparc64-linux-gcc.  */
diff -ur linux-2.2.14/include/linux/init.h linux-2.2.14+GNUC/include/linux/init.h
--- linux-2.2.14/include/linux/init.h	Mon Dec 28 18:08:10 1998
+++ linux-2.2.14+GNUC/include/linux/init.h	Thu Apr 27 12:36:05 2000
@@ -59,7 +59,7 @@
 #define __INITDATA
 #endif
 
-#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 8
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
 #define __initlocaldata  __initdata
 #else
 #define __initlocaldata
diff -ur linux-2.2.14/include/linux/linkage.h linux-2.2.14+GNUC/include/linux/linkage.h
--- linux-2.2.14/include/linux/linkage.h	Wed Dec  2 06:28:24 1998
+++ linux-2.2.14+GNUC/include/linux/linkage.h	Thu Apr 27 13:06:33 2000
@@ -7,7 +7,7 @@
 #define CPP_ASMLINKAGE
 #endif
 
-#if defined __i386__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 7)
+#if defined __i386__ && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 7)
 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
 #else
 #define asmlinkage CPP_ASMLINKAGE

Regards,
Graham
-- 
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

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