[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210114182318.GA967110@ubuntu-m3-large-x86>
Date: Thu, 14 Jan 2021 11:23:18 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Will Deacon <will@...nel.org>,
clang-built-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] kbuild: check the minimum compiler version in Kconfig
On Fri, Jan 15, 2021 at 03:07:09AM +0900, Masahiro Yamada wrote:
> Paul Gortmaker reported a regression in the GCC version check [1].
> If you use GCC 4.8, the build breaks before showing the error message
> "error Sorry, your version of GCC is too old - please use 4.9 or newer."
>
> I do not want to apply his fix-up since it implies we would not be able
> to remove any cc-option test. Anyway, I admit checking the GCC version
> in <linux/compiler-gcc.h> is too late.
>
> Almost at the same time, Linus also suggested to move the compiler
> version error to Kconfig time. [2]
>
> I unified the similar two scripts, gcc-version.sh and clang-version.sh
> into the new cc-version.sh. The old scripts invoked the compiler multiple
> times (3 times for gcc-version.sh, 4 times for clang-version.sh). I
> refactored the code so the new one invokes the compiler just once, and
> also tried my best to use shell-builtin commands where possible.
>
> The new script runs faster.
>
> $ time ./scripts/clang-version.sh clang
> 120000
>
> real 0m0.029s
> user 0m0.012s
> sys 0m0.021s
>
> $ time ./scripts/cc-version.sh clang
> Clang 120000
>
> real 0m0.009s
> user 0m0.006s
> sys 0m0.004s
>
> The cc-version.sh also shows the error if the compiler is old:
>
> $ make defconfig CC=clang-9
> *** Default configuration is based on 'x86_64_defconfig'
> ***
> *** Compiler is too old.
> *** Your Clang version: 9.0.1
> *** Minimum Clang version: 10.0.1
> ***
> scripts/Kconfig.include:46: Sorry, this compiler is not supported.
> make[1]: *** [scripts/kconfig/Makefile:81: defconfig] Error 1
> make: *** [Makefile:602: defconfig] Error 2
>
> I removed the clang version check from <linux/compiler-clang.h>
>
> For now, I did not touch <linux/compiler-gcc.h> in order to avoid
> merge conflict with [3], which has been queued up in the arm64 tree.
> We will be able to clean it up later.
>
> The new script takes care of ICC because we have <linux/compiler-intel.h>
> although I am not sure if building the kernel with ICC is well-supported.
>
> [1] https://lkml.org/lkml/2021/1/10/250
> [2] https://lkml.org/lkml/2021/1/12/1708
> [3] https://lkml.org/lkml/2021/1/12/1533
>
> Fixes: 87de84c9140e ("kbuild: remove cc-option test of -Werror=date-time")
> Reported-by: Paul Gortmaker <paul.gortmaker@...driver.com>
> Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
Reviewed-by: Nathan Chancellor <natechancellor@...il.com>
Tested-by: Nathan Chancellor <natechancellor@...il.com>
Powered by blists - more mailing lists