mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@linux.intel.com>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Florian Mickler <florian@mickler.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Russell King <linux@arm.linux.org.uk>,
	Mike Frysinger <vapier@gentoo.org>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: [PATCH 2/5] x86, gcc: Disallow building Linux/x86 with gcc 3.x/4.0
Date: Mon, 13 Sep 2010 13:14:37 -0700	[thread overview]
Message-ID: <1284408880-14414-3-git-send-email-hpa@linux.intel.com> (raw)
In-Reply-To: <1284408880-14414-1-git-send-email-hpa@linux.intel.com>

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


  parent reply	other threads:[~2010-09-13 20:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` H. Peter Anvin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284408880-14414-3-git-send-email-hpa@linux.intel.com \
    --to=hpa@linux.intel.com \
    --cc=florian@mickler.org \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome