linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Support gcc 6 for building
@ 2015-04-15 19:45 Andi Kleen
  2015-04-16  3:04 ` Segher Boessenkool
  2015-04-16  7:57 ` Michal Marek
  0 siblings, 2 replies; 13+ messages in thread
From: Andi Kleen @ 2015-04-15 19:45 UTC (permalink / raw)
  To: akpm; +Cc: mmarek, linux-kbuild, linux-kernel, Andi Kleen,
	Segher Boessenkool

From: Andi Kleen <ak@linux.intel.com>

gcc recently switched to a new version number scheme, where every version
gets a new major version number. The current version is 5.x, the next 6.x, etc.

The gcc git repository trunk branch just switched to report 6.x for the next
major release.

This breaks the way Linux selects compiler-gccX.h based on the major
version. Every new version would require adding a new compiler-gccX.h file,
which wouldn't really scale.

Let's assume that future gccs are fairly compatible (they are unlikely
to break anything Linux is relying on). So we can just keep using
compiler-gcc5.h, and select any specific differences with #if.

Cc: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/linux/compiler-gcc.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index cdf13ca..9c9a4e4 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -104,7 +104,12 @@
 #define __gcc_header(x) #x
 #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
 #define gcc_header(x) _gcc_header(x)
-#include gcc_header(__GNUC__)
+#if __GNUC__ < 5
+#define __LINUX_GCC_VERSION __GNUC__
+#else
+#define __LINUX_GCC_VERSION 5
+#endif
+#include gcc_header(__LINUX_GCC_VERSION)
 
 #if !defined(__noclone)
 #define __noclone	/* not needed */
-- 
2.3.3


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

end of thread, other threads:[~2015-04-20 21:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15 19:45 [PATCH] Support gcc 6 for building Andi Kleen
2015-04-16  3:04 ` Segher Boessenkool
2015-04-16  7:57 ` Michal Marek
2015-04-16 15:56   ` Andi Kleen
2015-04-16 16:23     ` Joe Perches
2015-04-16 16:29       ` Andi Kleen
2015-04-16 20:31         ` [PATCH 0/2] Integrate compiler-gcc[345].h files into compiler-gcc.h Joe Perches
2015-04-16 20:31           ` [PATCH 1/2] compiler-gcc.h: Neatening Joe Perches
2015-04-16 20:44             ` Joe Perches
2015-04-16 20:31           ` [PATCH 2/2] compiler-gcc: Integrate the various compiler-gcc[345].h files Joe Perches
2015-04-20 21:17           ` [PATCH 0/2] Integrate compiler-gcc[345].h files into compiler-gcc.h Andrew Morton
2015-04-20 21:24             ` Andi Kleen
2015-04-16 20:13     ` [PATCH] Support gcc 6 for building Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).