All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86
@ 2010-09-13 20:14 H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 1/5] Disallow building with gcc < 3.4 H. Peter Anvin
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-13 20:14 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Florian Mickler, Peter Zijlstra, Russell King, Mike Frysinger,
	Ingo Molnar, Thomas Gleixner, H. Peter Anvin

This patchset bumps the minimum supported gcc version to 3.4 for the
general kernel, and to 4.1 for x86.

We have had a rash of bug reports related to these really old
compilers and their associated binutils version lately, and it is
clear that the support burden of these older compilers is getting to
be excessive.  If you really want to build a kernel on a system that
old you can build or obtain an updated gcc/binutils as well.

 Documentation/Changes             |    2 +-
 arch/x86/include/asm/bitops.h     |    7 -------
 arch/x86/include/asm/cpufeature.h |    7 -------
 arch/x86/include/asm/string_32.h  |   21 ---------------------
 arch/x86/kernel/Makefile          |    3 ++-
 arch/x86/kernel/compiler.c        |    5 +++++
 include/linux/compiler-gcc3.h     |   15 +--------------
 7 files changed, 9 insertions(+), 51 deletions(-)

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

* [PATCH 1/5] Disallow building with gcc < 3.4
  2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
@ 2010-09-13 20:14 ` H. Peter Anvin
  2010-09-13 21:52   ` Russell King - ARM Linux
  2010-09-13 20:14 ` [PATCH 2/5] x86, gcc: Disallow building Linux/x86 with gcc 3.x/4.0 H. Peter Anvin
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-13 20:14 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Florian Mickler, Peter Zijlstra, Russell King, Mike Frysinger,
	Ingo Molnar, Thomas Gleixner, H. Peter Anvin, H. Peter Anvin

Disallow building the generic kernel code with gcc < 3.4.  Earlier
versions of gcc have known problems, and it appears that anyone who
genuinely needs gcc 3.x can use gcc 3.4 at this point.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 Documentation/Changes         |    2 +-
 include/linux/compiler-gcc3.h |   15 +--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/Documentation/Changes b/Documentation/Changes
index 4fb88f1..0ea8040 100644
--- a/Documentation/Changes
+++ b/Documentation/Changes
@@ -28,7 +28,7 @@ necessary on all systems; obviously, if you don't have any ISDN
 hardware, for example, you probably needn't concern yourself with
 isdn4k-utils.
 
-o  Gnu C                  3.2                     # gcc --version
+o  Gnu C                  3.4                     # gcc --version
 o  Gnu make               3.80                    # make --version
 o  binutils               2.12                    # ld -v
 o  util-linux             2.10o                   # fdformat --version
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
index b721129..c11d443 100644
--- a/include/linux/compiler-gcc3.h
+++ b/include/linux/compiler-gcc3.h
@@ -2,25 +2,12 @@
 #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
 #endif
 
-#if __GNUC_MINOR__ < 2
+#if __GNUC_MINOR__ < 4
 # error Sorry, your compiler is too old - please upgrade it.
 #endif
 
-#if __GNUC_MINOR__ >= 3
 # define __used			__attribute__((__used__))
-#else
-# define __used			__attribute__((__unused__))
-#endif
-
-#if __GNUC_MINOR__ >= 4
 #define __must_check		__attribute__((warn_unused_result))
-#endif
-
-#ifdef CONFIG_GCOV_KERNEL
-# if __GNUC_MINOR__ < 4
-#   error "GCOV profiling support for gcc versions below 3.4 not included"
-# endif /* __GNUC_MINOR__ */
-#endif /* CONFIG_GCOV_KERNEL */
 
 /*
  * A trick to suppress uninitialized variable warning without generating any
-- 
1.7.2.1


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

* [PATCH 2/5] x86, gcc: Disallow building Linux/x86 with gcc 3.x/4.0
  2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 1/5] Disallow building with gcc < 3.4 H. Peter Anvin
@ 2010-09-13 20:14 ` H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 3/5] x86, cpu: Remove gcc 3.x workarounds in <asm/cpufeature.h> H. Peter Anvin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-13 20:14 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Florian Mickler, Peter Zijlstra, Russell King, Mike Frysinger,
	Ingo Molnar, Thomas Gleixner, H. Peter Anvin, H. Peter Anvin

We are starting to get "straggler problems" with people compiling
current Linux kernels with now-ancient versions of gcc.  All the
development is being done against gcc 4.x; this simply disallows gcc
4.0 or earlier.

We disallow 4.0 as well as 3.x because 4.0 had a fair share of bugs
especially around asm() statements; this allows us to remove those
workarounds.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/Makefile   |    3 ++-
 arch/x86/kernel/compiler.c |    5 +++++
 2 files changed, 7 insertions(+), 1 deletions(-)
 create mode 100644 arch/x86/kernel/compiler.c

diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 0925676..a6459b7 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -29,7 +29,8 @@ GCOV_PROFILE_hpet.o		:= n
 GCOV_PROFILE_tsc.o		:= n
 GCOV_PROFILE_paravirt.o		:= n
 
-obj-y			:= process_$(BITS).o signal.o entry_$(BITS).o
+obj-y			:= compiler.o
+obj-y			+= process_$(BITS).o signal.o entry_$(BITS).o
 obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
 obj-y			+= time.o ioport.o ldt.o dumpstack.o
 obj-y			+= setup.o x86_init.o i8259.o irqinit.o
diff --git a/arch/x86/kernel/compiler.c b/arch/x86/kernel/compiler.c
new file mode 100644
index 0000000..8914974
--- /dev/null
+++ b/arch/x86/kernel/compiler.c
@@ -0,0 +1,5 @@
+#if __GNUC__ < 4
+#error "Compiling Linux/x86 with gcc 3.x is no longer supported"
+#elif __GNUC__ == 4 && __GNUC_MINOR__ < 1
+#error "Compiling Linux/x86 with gcc 4.0 is not supported"
+#endif
-- 
1.7.2.1


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

* [PATCH 3/5] x86, cpu: Remove gcc 3.x workarounds in <asm/cpufeature.h>
  2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 1/5] Disallow building with gcc < 3.4 H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 2/5] x86, gcc: Disallow building Linux/x86 with gcc 3.x/4.0 H. Peter Anvin
@ 2010-09-13 20:14 ` H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 4/5] x86, mem: Remove gcc < 4.1 support code for memcpy() H. Peter Anvin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-13 20:14 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Florian Mickler, Peter Zijlstra, Russell King, Mike Frysinger,
	Ingo Molnar, Thomas Gleixner, H. Peter Anvin, H. Peter Anvin

We no longer support gcc 3.x, so remove the workaround for it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/cpufeature.h |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 781a50b..830a94f 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -345,7 +345,6 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
 #endif
 }
 
-#if __GNUC__ >= 4
 #define static_cpu_has(bit)					\
 (								\
 	__builtin_constant_p(boot_cpu_has(bit)) ?		\
@@ -354,12 +353,6 @@ static __always_inline __pure bool __static_cpu_has(u16 bit)
 		__static_cpu_has(bit) :				\
 		boot_cpu_has(bit)				\
 )
-#else
-/*
- * gcc 3.x is too stupid to do the static test; fall back to dynamic.
- */
-#define static_cpu_has(bit) boot_cpu_has(bit)
-#endif
 
 #endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
 
-- 
1.7.2.1


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

* [PATCH 4/5] x86, mem: Remove gcc < 4.1 support code for memcpy()
  2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
                   ` (2 preceding siblings ...)
  2010-09-13 20:14 ` [PATCH 3/5] x86, cpu: Remove gcc 3.x workarounds in <asm/cpufeature.h> H. Peter Anvin
@ 2010-09-13 20:14 ` H. Peter Anvin
  2010-09-13 20:14 ` [PATCH 5/5] x86, bitops: Remove gcc < 4.1 workaround H. Peter Anvin
  2010-09-14  0:11 ` [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 Brian Gerst
  5 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-13 20:14 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Florian Mickler, Peter Zijlstra, Russell King, Mike Frysinger,
	Ingo Molnar, Thomas Gleixner, H. Peter Anvin, H. Peter Anvin

We require gcc 4.1 or later, so remove support code for previous
versions of gcc.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/string_32.h |   21 ---------------------
 1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index 3d3e835..fde4eb2 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -177,16 +177,8 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
  */
 
 #ifndef CONFIG_KMEMCHECK
-
-#if (__GNUC__ >= 4)
 #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
 #else
-#define memcpy(t, f, n)				\
-	(__builtin_constant_p((n))		\
-	 ? __constant_memcpy((t), (f), (n))	\
-	 : __memcpy((t), (f), (n)))
-#endif
-#else
 /*
  * kmemcheck becomes very happy if we use the REP instructions unconditionally,
  * because it means that we know both memory operands in advance.
@@ -284,12 +276,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
 
 	{
 		int d0, d1;
-#if __GNUC__ == 4 && __GNUC_MINOR__ == 0
-		/* Workaround for broken gcc 4.0 */
-		register unsigned long eax asm("%eax") = pattern;
-#else
 		unsigned long eax = pattern;
-#endif
 
 		switch (count % 4) {
 		case 0:
@@ -321,15 +308,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
 	 : __memset_generic((s), (c), (count)))
 
 #define __HAVE_ARCH_MEMSET
-#if (__GNUC__ >= 4)
 #define memset(s, c, count) __builtin_memset(s, c, count)
-#else
-#define memset(s, c, count)						\
-	(__builtin_constant_p(c)					\
-	 ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \
-				 (count))				\
-	 : __memset((s), (c), (count)))
-#endif
 
 /*
  * find the first occurrence of byte 'c', or 1 past the area if none
-- 
1.7.2.1


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

* [PATCH 5/5] x86, bitops: Remove gcc < 4.1 workaround
  2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
                   ` (3 preceding siblings ...)
  2010-09-13 20:14 ` [PATCH 4/5] x86, mem: Remove gcc < 4.1 support code for memcpy() H. Peter Anvin
@ 2010-09-13 20:14 ` H. Peter Anvin
  2010-09-14  0:11 ` [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 Brian Gerst
  5 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-13 20:14 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Florian Mickler, Peter Zijlstra, Russell King, Mike Frysinger,
	Ingo Molnar, Thomas Gleixner, H. Peter Anvin, H. Peter Anvin

Remove workaround for gcc older than 4.1.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/bitops.h |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 545776e..1532109 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -22,14 +22,7 @@
  *
  * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
  */
-
-#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1)
-/* Technically wrong, but this avoids compilation errors on some gcc
-   versions. */
-#define BITOP_ADDR(x) "=m" (*(volatile long *) (x))
-#else
 #define BITOP_ADDR(x) "+m" (*(volatile long *) (x))
-#endif
 
 #define ADDR				BITOP_ADDR(addr)
 
-- 
1.7.2.1


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

* Re: [PATCH 1/5] Disallow building with gcc < 3.4
  2010-09-13 20:14 ` [PATCH 1/5] Disallow building with gcc < 3.4 H. Peter Anvin
@ 2010-09-13 21:52   ` Russell King - ARM Linux
  0 siblings, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2010-09-13 21:52 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, linux-arch, Florian Mickler, Peter Zijlstra,
	Mike Frysinger, Ingo Molnar, Thomas Gleixner, H. Peter Anvin

On Mon, Sep 13, 2010 at 01:14:36PM -0700, H. Peter Anvin wrote:
> Disallow building the generic kernel code with gcc < 3.4.  Earlier
> versions of gcc have known problems, and it appears that anyone who
> genuinely needs gcc 3.x can use gcc 3.4 at this point.
> 
> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

Reviewed-by: Russell King <rmk+kernel@arm.linux.org.uk>

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

* Re: [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86
  2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
                   ` (4 preceding siblings ...)
  2010-09-13 20:14 ` [PATCH 5/5] x86, bitops: Remove gcc < 4.1 workaround H. Peter Anvin
@ 2010-09-14  0:11 ` Brian Gerst
  2010-09-15 22:24   ` H. Peter Anvin
  5 siblings, 1 reply; 9+ messages in thread
From: Brian Gerst @ 2010-09-14  0:11 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel, linux-arch, H. Peter Anvin

On Mon, Sep 13, 2010 at 4:14 PM, H. Peter Anvin <hpa@linux.intel.com> wrote:
> This patchset bumps the minimum supported gcc version to 3.4 for the
> general kernel, and to 4.1 for x86.
>
> We have had a rash of bug reports related to these really old
> compilers and their associated binutils version lately, and it is
> clear that the support burden of these older compilers is getting to
> be excessive.  If you really want to build a kernel on a system that
> old you can build or obtain an updated gcc/binutils as well.

What version of binutils does this correspond to?  It would be nice to
clean up some of the hacks for ancient binutils as well.

--
Brian Gerst

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

* Re: [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86
  2010-09-14  0:11 ` [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 Brian Gerst
@ 2010-09-15 22:24   ` H. Peter Anvin
  0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-09-15 22:24 UTC (permalink / raw)
  To: Brian Gerst; +Cc: H. Peter Anvin, linux-kernel, linux-arch

On 09/13/2010 05:11 PM, Brian Gerst wrote:
> On Mon, Sep 13, 2010 at 4:14 PM, H. Peter Anvin <hpa@linux.intel.com> wrote:
>> This patchset bumps the minimum supported gcc version to 3.4 for the
>> general kernel, and to 4.1 for x86.
>>
>> We have had a rash of bug reports related to these really old
>> compilers and their associated binutils version lately, and it is
>> clear that the support burden of these older compilers is getting to
>> be excessive.  If you really want to build a kernel on a system that
>> old you can build or obtain an updated gcc/binutils as well.
> 
> What version of binutils does this correspond to?  It would be nice to
> clean up some of the hacks for ancient binutils as well.
> 

4.1 -> 2.16
3.4 -> 2.14/2.15 (gcc 3.4.0 beat binutils 2.15 by a mere 29 days)

This is somewhat unfortunate, since neither of these brackets eliminate
the Binutils Version From Hell, a.k.a. 2.16.

	-hpa



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

end of thread, other threads:[~2010-09-15 22:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-13 20:14 [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 H. Peter Anvin
2010-09-13 20:14 ` [PATCH 1/5] Disallow building with gcc < 3.4 H. Peter Anvin
2010-09-13 21:52   ` Russell King - ARM Linux
2010-09-13 20:14 ` [PATCH 2/5] x86, gcc: Disallow building Linux/x86 with gcc 3.x/4.0 H. Peter Anvin
2010-09-13 20:14 ` [PATCH 3/5] x86, cpu: Remove gcc 3.x workarounds in <asm/cpufeature.h> H. Peter Anvin
2010-09-13 20:14 ` [PATCH 4/5] x86, mem: Remove gcc < 4.1 support code for memcpy() H. Peter Anvin
2010-09-13 20:14 ` [PATCH 5/5] x86, bitops: Remove gcc < 4.1 workaround H. Peter Anvin
2010-09-14  0:11 ` [RFC PATCH 0/5] Bump gcc minimum version to 3.4, 4.1 for x86 Brian Gerst
2010-09-15 22:24   ` H. Peter Anvin

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.