[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUVhw6Pry-N3dZNHKYz1UqEg0-ePOYepoe7rn15+S5zGgA@mail.gmail.com>
Date: Thu, 27 Aug 2020 09:16:54 +0200
From: Sedat Dilek <sedat.dilek@...il.com>
To: Kees Cook <keescook@...omium.org>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Nathan Chancellor <natechancellor@...il.com>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Marco Elver <elver@...gle.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Sami Tolvanen <samitolvanen@...gle.com>,
linux-kernel@...r.kernel.org,
Clang-Built-Linux ML <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] compiler-clang: add build check for clang 10.0.1
On Wed, Aug 26, 2020 at 11:01 PM Kees Cook <keescook@...omium.org> wrote:
>
> On Wed, Aug 26, 2020 at 01:14:19PM -0700, Nick Desaulniers wrote:
> > During Plumbers 2020, we voted to just support the latest release of
> > Clang for now. Add a compile time check for this.
> >
> > Older clang's may work, but we will likely drop workarounds for older
> > versions.
> >
> > Link: https://github.com/ClangBuiltLinux/linux/issues/9
> > Link: https://github.com/ClangBuiltLinux/linux/issues/941
> > Suggested-by: Sedat Dilek <sedat.dilek@...il.com>
> > Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
> > ---
> > include/linux/compiler-clang.h | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
> > index cee0c728d39a..7338d3ffd240 100644
> > --- a/include/linux/compiler-clang.h
> > +++ b/include/linux/compiler-clang.h
> > @@ -3,6 +3,14 @@
> > #error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
> > #endif
> >
> > +#define CLANG_VERSION (__clang_major__ * 10000 \
> > + + __clang_minor__ * 100 \
> > + + __clang_patchlevel__)
> > +
> > +#if CLANG_VERSION < 100001
> > +# error Sorry, your compiler is too old - please upgrade it.
>
> Perhaps a bike-shed suggestion, but I think we should make this message
> as specific (and helpful) as possible:
>
> # error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
>
Agreed... Information about the required minimum version is user-friendly.
- Sedat -
> Then anyone seeing this has several pieces of information:
>
> - the kernel build was attempting to use Clang
> (maybe they accidentally poked the wrong configs in a CI)
> - they need 10.0.1 or better
> ("upgrade to what version?" doesn't need to be dug out of documentation,
> headers, etc)
>
> With that, yes, let's do it. :)
>
> Reviewed-by: Kees Cook <keescook@...omium.org>
>
> (And likely we should improve the GCC message at the same time...)
>
> --
> Kees Cook
Powered by blists - more mailing lists