android_kernel_xiaomi_sm8450/include
Masahiro Yamada 38a74c4bad
UPSTREAM: kbuild: check the minimum compiler version in Kconfig
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 two similar scripts, gcc-version.sh and clang-version.sh
into 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

cc-version.sh also shows an error message if the compiler is too 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

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://lore.kernel.org/r/20210110190807.134996-1-paul.gortmaker@windriver.com
[2]: https://lore.kernel.org/r/CAHk-=wh-+TMHPTFo1qs-MYyK7tZh-OQovA=pP3=e06aCVp6_kA@mail.gmail.com

Fixes: 87de84c914 ("kbuild: remove cc-option test of -Werror=date-time")
Reported-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Bug: 210043760
(cherry picked from commit aec6c60a01d3a3170242d6a99372a388e1136dc6)
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I61e4eb8b4ef5466d0ee8c5892973734c98529b17
2024-05-08 03:00:08 +03:00
..
acpi ACPI: APEI: explicit init of HEST and GHES in apci_init() 2023-09-19 12:20:28 +02:00
asm-generic This is the 5.10.190 stable release 2023-08-25 12:26:58 +00:00
clocksource
crypto Revert "crypto: api - Use work queue in crypto_destroy_instance" 2023-09-30 12:31:38 +00:00
drm Revert "drm/display/dp: Fix the DP DSC Receiver cap size" 2023-09-01 17:04:58 +00:00
dt-bindings Merge keystone/android12-5.10-keystone-qcom-release.198+ (0ebfe67) into msm-5.10 2023-12-05 16:20:08 +05:30
keys
kunit
kvm
linux UPSTREAM: kbuild: check the minimum compiler version in Kconfig 2024-05-08 03:00:08 +03:00
math-emu
media Merge keystone/android12-5.10-keystone-qcom-release.198+ (0ebfe67) into msm-5.10 2023-12-05 16:20:08 +05:30
memory
misc
net Merge keystone/android12-5.10-keystone-qcom-release.198+ (0ebfe67) into msm-5.10 2023-12-05 16:20:08 +05:30
pcmcia
ras
rdma RDMA/cma: Always set static rate to 0 for RoCE 2023-06-21 15:45:39 +02:00
scsi Revert "scsi: core: Use 32-bit hostnum in scsi_host_lookup()" 2023-10-03 17:17:03 +00:00
soc Merge keystone/android12-5.10-keystone-qcom-release.185+ (7a5953e) into msm-5.10 2023-09-25 13:30:11 +05:30
sound Merge keystone/android12-5.10-keystone-qcom-release.185+ (7a5953e) into msm-5.10 2023-09-25 13:30:11 +05:30
target scsi: target: Fix multiple LUN_RESET handling 2023-05-17 11:47:48 +02:00
trace Merge keystone/android12-5.10-keystone-qcom-release.198+ (0ebfe67) into msm-5.10 2023-12-05 16:20:08 +05:30
uapi epoll: drop struct epoll_event definition 2024-05-07 01:22:28 +03:00
vdso
video
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-17 11:47:42 +02:00