From: Joe Perches <joe@perches.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>, Kan Liang <kan.liang@linux.intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Kees Cook <keescook@chromium.org>, Shawn Landden <shawn@git.icu>,
Nathan Chancellor <natechancellor@gmail.com>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
Chandler Carruth <chandlerc@google.com>,
clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] perf/x86/intel: Mark expected switch fall-throughs
Date: Tue, 25 Jun 2019 16:25:53 -0700 [thread overview]
Message-ID: <c32b1f6381d0fcdc2a054c778e233b95dc728068.camel@perches.com> (raw)
In-Reply-To: <CAKwvOdnzrMOCo4RRsfcR=K5ELWU8obgMqtOGZnx_avLrArjpRQ@mail.gmail.com>
On Tue, 2019-06-25 at 15:57 -0700, Nick Desaulniers wrote:
> consider most other GNU C extensions. How do I
> test whether they exist in my compiler or not? Is it everything or
> nothing (do they all have to exist?).
Until such time as the linux source code supports alternate
mechanisms for existing gcc extension uses, I think yes.
> In those cases you either end
> up shelling out to something like autoconf (which is what I consider
> the current infra around CONFIG_CC_HAS_ASM_GOTO), or code filled with
> tons of version checks for specific compilers which are brittle.
Or just one...
> Of the two cases, now consider what happens when my compiler that
> previously did not support a particular feature now does. In the
> first case, the guards were compiler agnostic, and I *don't have to
> change the source* to make use of the feature in the new compiler. In
> the second case, I *need to modify the source* to update the version
> checks to be correct.
[]
> Back to your point about adding a minimal version of Clang to the
> kernel; I don't really want to do this. For non-x86 architectures,
> people are happily compiling their kernels with versions of clang as
> old as clang-4.
Perhaps:
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64)
#define CLANG_MINIMUM_VERSION 90000
#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
#define CLANG_MINIMUM_VERSION 40000
#else
etc...
#endif
#if CLANG_VERSION < CLANG_MINIMUM_VERSION
etc...
#endif
> and if it continues to work for them; I'm happy. And
> if it doesn't, and they raise an alarm, we're happy to take a look.
> Old LTS distros may have ancient builds of clang, so maybe some kind
> of hint would be nice, but I'd also like to support older versions
> where we can and I think choosing clang-9 for x86's sake is too
> x86-centric. A version check on CONFIG_JUMP_LABEL is maybe more
> appropriate, so it cannot be selected if you're using clang && your
> version of clang is not clang-9 or greater?
The now non-portable nature of .config files might be
improved.
next prev parent reply other threads:[~2019-06-25 23:26 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 16:19 Gustavo A. R. Silva
2019-06-24 19:31 ` Peter Zijlstra
2019-06-24 19:45 ` Joe Perches
2019-06-24 20:37 ` Peter Zijlstra
2019-06-24 20:53 ` Gustavo A. R. Silva
2019-06-24 20:57 ` Joe Perches
2019-06-25 7:20 ` Peter Zijlstra
2019-06-24 22:28 ` Miguel Ojeda
2019-06-25 7:18 ` Peter Zijlstra
2019-06-25 12:47 ` Miguel Ojeda
2019-06-25 18:15 ` Nick Desaulniers
2019-06-25 22:29 ` Joe Perches
2019-06-25 22:57 ` Nick Desaulniers
2019-06-25 23:25 ` Joe Perches [this message]
2019-06-26 8:49 ` Peter Zijlstra
2019-06-26 22:14 ` Nick Desaulniers
2019-06-27 7:12 ` Peter Zijlstra
2019-06-28 13:31 ` Peter Zijlstra
2019-06-28 18:44 ` Nick Desaulniers
2019-06-29 7:10 ` Peter Zijlstra
2019-06-25 17:12 ` Kees Cook
2019-06-25 18:05 ` Nathan Chancellor
2019-06-25 19:53 ` Thomas Gleixner
2019-06-25 20:27 ` Nathan Chancellor
2019-06-25 20:37 ` Nick Desaulniers
2019-06-25 21:47 ` Thomas Gleixner
2019-06-26 5:10 ` Nathan Chancellor
2019-06-26 15:18 ` Thomas Gleixner
2019-06-26 19:00 ` Nathan Chancellor
2019-06-26 19:46 ` Thomas Gleixner
2019-06-26 20:03 ` Nathan Chancellor
2019-06-26 9:24 ` Peter Zijlstra
2019-06-26 9:55 ` Peter Zijlstra
2019-06-26 22:23 ` Nick Desaulniers
2019-06-27 7:35 ` Peter Zijlstra
2019-06-26 10:43 ` Peter Zijlstra
2019-06-26 22:15 ` Nick Desaulniers
2019-06-27 7:16 ` Peter Zijlstra
2019-06-26 16:30 ` Peter Zijlstra
2019-06-26 22:33 ` Nick Desaulniers
2019-06-26 23:11 ` Thomas Gleixner
2019-06-27 7:11 ` Peter Zijlstra
2019-06-25 23:46 ` Arnaldo Carvalho de Melo
2019-06-26 5:14 ` Nathan Chancellor
2019-06-25 20:09 ` Kees Cook
2019-06-26 8:06 ` Peter Zijlstra
2019-06-25 7:15 ` Peter Zijlstra
2019-07-25 16:27 ` [tip:perf/urgent] " tip-bot for Gustavo A. R. Silva
2019-07-25 17:06 ` Borislav Petkov
2019-07-25 17:35 ` Peter Zijlstra
2019-07-25 23:18 ` Joe Perches
2019-07-25 23:28 ` Kees Cook
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=c32b1f6381d0fcdc2a054c778e233b95dc728068.camel@perches.com \
--to=joe@perches.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=chandlerc@google.com \
--cc=clang-built-linux@googlegroups.com \
--cc=gustavo@embeddedor.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=kan.liang@linux.intel.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=shawn@git.icu \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®