lkml.org 
[lkml]   [2020]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] compiler-clang: add build check for clang 10.0.1
On Wed, Aug 26, 2020 at 10:14 PM Nick Desaulniers
<ndesaulniers@google.com> 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@gmail.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Nice to see This Is Happening!

See also my other replies to Kees and Nathan comments.

Acked-by: Sedat Dilek <sedat.dilek@gmail.com>

- Sedat -

> ---
> 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.
> +#endif
> +
> /* Compiler specific definitions for Clang compiler */
>
> /* same as gcc, this was present in clang-2.6 so we can assume it works
> --
> 2.28.0.297.g1956fa8f8d-goog
>

\
 
 \ /
  Last update: 2020-08-27 09:22    [W:0.090 / U:2.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site