public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Joe Perches <joe@perches.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	akpm@linuxfoundation.org, mingo@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel: add support for gcc 5
Date: Fri, 05 Sep 2014 06:08:53 +0200	[thread overview]
Message-ID: <1409890133.10788.23.camel@localhost> (raw)
In-Reply-To: <54092FE0.3030004@oracle.com>

On Do, 2014-09-04 at 23:37 -0400, Sasha Levin wrote:
> On 09/04/2014 07:47 PM, Joe Perches wrote:
> > On Fri, 2014-09-05 at 00:43 +0200, Hannes Frederic Sowa wrote:
> >> > Most statements are already depending on GCC_VERSION, maybe we can just
> >> > unify all gcc specific headers to one, still trying to keep the file
> >> > organized? ;)
> > Maybe something like:
> > 
> > gnu development of gcc will be more frequent and the use of
> > compiler-gcc<major>.h likely will not be convenient anymore.
> > 
> > Integrate the individual compiler-gcc<major>.h files into
> > compiler-gcc.h.
> 
> Please no. We have a similar file we maintain in our team that's supposed to
> do something very similar for kernel versions. It goes all the way back to
> 2.6.9 and it's a *horrible* mess.
> 
> This is how compiler-gcc.h will end up looking in a while.

Something along these lines? We can make '4' a macro describing it
references the latest possible compiler-gccX.h file.

--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -103,7 +103,12 @@
 #define __gcc_header(x) #x
 #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
 #define gcc_header(x) _gcc_header(x)
+
+#if __GNUC__ > 4
+#include gcc_header(4)
+#else
 #include gcc_header(__GNUC__)
+#endif
 
 #if !defined(__noclone)
 #define __noclone      /* not needed */


I still think we should start chaining newer gcc header files to
deduplicate the content. What do you think?

Bye,
Hannes



  parent reply	other threads:[~2014-09-05  4:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04 15:37 [PATCH] kernel: add support for gcc 5 Sasha Levin
2014-09-04 21:12 ` Andrew Morton
2014-09-04 21:19   ` Richard Weinberger
2014-09-04 21:25     ` Andrew Morton
2014-09-04 21:38       ` Sasha Levin
2014-09-05 15:04       ` H. Peter Anvin
2014-09-04 21:25 ` Aaro Koskinen
2014-09-04 21:32   ` Sasha Levin
2014-09-04 22:43   ` Hannes Frederic Sowa
2014-09-04 23:47     ` Joe Perches
2014-09-05  3:37       ` Sasha Levin
2014-09-05  3:58         ` Joe Perches
2014-09-05  4:08         ` Hannes Frederic Sowa [this message]
2014-09-05 14:44           ` Sasha Levin
2014-09-05 20:39             ` [PATCH] gcc: clamp gcc version to most highest specific header version available Hannes Frederic Sowa
2014-09-05 21:09               ` Joe Perches
2014-09-05 22:38                 ` Hannes Frederic Sowa

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=1409890133.10788.23.camel@localhost \
    --to=hannes@stressinduktion.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=akpm@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sasha.levin@oracle.com \
    /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