On Mon, Nov 02, 2020 at 11:38:14PM -0700, Nathan Chancellor wrote: > On Tue, Nov 03, 2020 at 06:55:21AM +0200, Jarkko Sakkinen wrote: > > On Wed, Sep 02, 2020 at 03:59:05PM -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. > > > > > > We plan to remove workarounds for older versions now, which will break > > > in subtle and not so subtle ways. > > > > > > Suggested-by: Sedat Dilek > > > Suggested-by: Nathan Chancellor > > > Suggested-by: Kees Cook > > > Signed-off-by: Nick Desaulniers > > > Tested-by: Sedat Dilek > > > Reviewed-by: Kees Cook > > > Reviewed-by: Miguel Ojeda > > > Reviewed-by: Sedat Dilek > > > Acked-by: Marco Elver > > > Acked-by: Nathan Chancellor > > > Acked-by: Sedat Dilek > > > Link: https://github.com/ClangBuiltLinux/linux/issues/9 > > > Link: https://github.com/ClangBuiltLinux/linux/issues/941 > > > --- > > > 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..230604e7f057 100644 > > > --- a/include/linux/compiler-clang.h > > > +++ b/include/linux/compiler-clang.h > > > @@ -3,6 +3,14 @@ > > > #error "Please don't include directly, include 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 > > > > > > I'm trying to compile a BPF enabled test kernel for a live system and I > > get this error even though I have much newer clang: > > > > ➜ ~ (master) ✔ clang --version > > Ubuntu clang version 11.0.0-2 > > Target: x86_64-pc-linux-gnu > > Thread model: posix > > InstalledDir: /usr/bin > > > > Tried to Google for troubleshooter tips but this patch is basically the > > only hit I get :-) > > Do you have a .config and command to reproduce the error? Attached. > Cheers, > Nathan /Jarkko