diff options
author | Nick Desaulniers <[email protected]> | 2020-10-13 16:47:33 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-10-13 18:38:26 -0700 |
commit | 1f7a44f63e6c782c9c2aa9f18f40c23914e6b46a (patch) | |
tree | 2ec5834e99a0dceeac293d0ddc7bbe2773b146e3 /include/linux/compiler-clang.h | |
parent | 029f56db6ac248769f2c260bfaf3c3c0e23e904c (diff) |
compiler-clang: add build check for clang 10.0.1
Patch series "set clang minimum version to 10.0.1", v3.
Adds a compile time #error to compiler-clang.h setting the effective
minimum supported version to clang 10.0.1. A separate patch has already
been picked up into the Documentation/ tree also confirming the version.
Next are a series of reverts. One for 32b arm is a partial revert.
Then Marco suggested fixes to KASAN docs.
Finally, improve the warning for GCC too as per Kees.
This patch (of 7):
During Plumbers 2020, we voted to just support the latest release of Clang
for now. Add a compile time check for this.
We plan to remove workarounds for older versions now, which will break in
subtle and not so subtle ways.
Suggested-by: Sedat Dilek <[email protected]>
Suggested-by: Nathan Chancellor <[email protected]>
Suggested-by: Kees Cook <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Tested-by: Sedat Dilek <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Miguel Ojeda <[email protected]>
Reviewed-by: Sedat Dilek <[email protected]>
Acked-by: Marco Elver <[email protected]>
Acked-by: Nathan Chancellor <[email protected]>
Acked-by: Sedat Dilek <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Fangrui Song <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Vincenzo Frascino <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://github.com/ClangBuiltLinux/linux/issues/9
Link: https://github.com/ClangBuiltLinux/linux/issues/941
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux/compiler-clang.h')
-rw-r--r-- | include/linux/compiler-clang.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index cee0c728d39a..230604e7f057 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 version of Clang is too old - please use 10.0.1 or newer. +#endif + /* Compiler specific definitions for Clang compiler */ /* same as gcc, this was present in clang-2.6 so we can assume it works |