[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNARi-=oJxN7ohkV_eBBZQ-YyyfrZyjxbfqQetD9Fwn46iw@mail.gmail.com>
Date: Wed, 22 Aug 2018 02:07:40 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Joe Perches <joe@...ches.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Jonathan Corbet <corbet@....net>,
Arnd Bergmann <arnd@...db.de>,
David Woodhouse <dwmw@...zon.co.uk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Will Deacon <will.deacon@....com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] compiler-gcc: get back Clang build
2018-08-22 1:33 GMT+09:00 Joe Perches <joe@...ches.com>:
> On Tue, 2018-08-21 at 15:48 +0900, Masahiro Yamada wrote:
>> Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6")
>> missed the fact that <linux/compiler-gcc.h> is included by Clang
>> as well as by GCC.
>>
>> Clang actually defines __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
>> and it looks like GCC 4.2.1.
>>
>> $ scripts/gcc-version.sh -p clang
>> 040201
>>
>> If you try to build the kernel with Clang, you will get the
>> "Sorry, your compiler is too old - please upgrade it."
>> followed by a bunch of "unknown attribute" warnings.
>>
>> Add !defined(__clang__) to the minimum version check.
>>
>> Also, revive the version test blocks for versions >= 4.2.1
>> in order to disable features not supported by Clang.
>
> What is the minimum clang version required to compile the kernel?
> What features are not supported by the minimum clang version?
>
> On my system, using clang
>
> $ clang -v
> clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
>
> and
>
> $ git checkout v4.16 ; make clean ; make CC=clang defconfig ; make CC=clang
> HEAD is now at 0adb32858b0b... Linux 4.16
>
> is successful
>
> but
>
> $ git checkout v4.17 ; make clean ; make CC=clang defconfig ; make CC=clang
> HEAD is now at 29dcea88779c... Linux 4.17
> arch/x86/Makefile:184: *** Compiler lacks asm-goto support.. Stop.
> arch/x86/Makefile:184: *** Compiler lacks asm-goto support.. Stop.
>
You cannot build x86 because asm-goto support is missing in clang.
How about building arm or arm64?
$ make ARCH=arm CC=clang CROSS_COMPILE=arm-linux-gnueabihf- defconfig all
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists