android_kernel_xiaomi_sm8450/init
Masahiro Yamada 4f7b5aed0a
BACKPORT: kbuild: check the minimum linker version in Kconfig
Unify the two scripts/ld-version.sh and scripts/lld-version.sh, and
check the minimum linker version like scripts/cc-version.sh did.

I tested this script for some corner cases reported in the past:

 - GNU ld version 2.25-15.fc23
   as reported by commit 8083013fc3 ("ld-version: Fix it on Fedora")

 - GNU ld (GNU Binutils) 2.20.1.20100303
   as reported by commit 0d61ed17dd ("ld-version: Drop the 4th and
   5th version components")

This script show an error message if the linker is too old:

  $ make LD=ld.lld-9
    SYNC    include/config/auto.conf
  ***
  *** Linker is too old.
  ***   Your LLD version:    9.0.1
  ***   Minimum LLD version: 10.0.1
  ***
  scripts/Kconfig.include:50: Sorry, this linker is not supported.
  make[2]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1
  make[1]: *** [Makefile:600: syncconfig] Error 2
  make: *** [Makefile:708: include/config/auto.conf] Error 2

I also moved the check for gold to this script, so gold is still rejected:

  $ make LD=gold
    SYNC    include/config/auto.conf
  gold linker is not supported as it is not capable of linking the kernel proper.
  scripts/Kconfig.include:50: Sorry, this linker is not supported.
  make[2]: *** [scripts/kconfig/Makefile:71: syncconfig] Error 1
  make[1]: *** [Makefile:600: syncconfig] Error 2
  make: *** [Makefile:708: include/config/auto.conf] Error 2

Thanks to David Laight for suggesting shell script improvements.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
[nd: conflict in scripts/lld-version.sh due to df58fb431a
  ("scripts/lld-version.sh: Rewrite based on upstream ld-version.sh")
  being 5.10 only]
Bug: 210043760
(cherry picked from commit 02aff85922043cf175ebbe5fc3430acfeaeb8393)
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: I1618f31566b84dd601ca2c9665f6d341df56537d
2024-05-08 03:00:08 +03:00
..
calibrate.c
do_mounts_initrd.c Merge branch 'hch.init_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 09:40:34 -07:00
do_mounts_rd.c init: add an init_unlink helper 2020-07-31 08:17:52 +02:00
do_mounts.c init: add an init_chroot helper 2020-07-31 08:17:52 +02:00
do_mounts.h init: add an init_mknod helper 2020-07-31 08:17:54 +02:00
init_task.c ANDROID: Split ANDROID_STRUCT_PADDING into separate configs 2022-04-07 05:44:50 +00:00
initramfs.c initramfs: fix clang build failure 2020-12-11 14:02:14 -08:00
Kconfig BACKPORT: kbuild: check the minimum linker version in Kconfig 2024-05-08 03:00:08 +03:00
Kconfig.gki ANDROID: GKI: Kconfig.gki: Add GKI_HIDDEN_ETHERNET_CONFIGS 2021-06-14 07:09:47 +00:00
Kconfig.gki-debug ANDROID: qki: Add consolidate config 2021-05-05 19:49:45 -07:00
main.c This is the 5.10.189 stable release 2023-08-23 15:12:23 +00:00
Makefile md: move the early init autodetect code to drivers/md/ 2020-07-16 15:34:47 +02:00
noinitramfs.c init: add an init_mknod helper 2020-07-31 08:17:54 +02:00
version.c