aboutsummaryrefslogtreecommitdiff
path: root/scripts/ld-version.sh
diff options
context:
space:
mode:
authorMasahiro Yamada2021-03-16 01:12:55 +0900
committerMasahiro Yamada2021-04-25 05:14:26 +0900
commite24b3ffcf4216d819b52618b6f17ba7410d1d845 (patch)
tree744a4dcc8d480a9f54bb88cecbcdeaec17f2e43d /scripts/ld-version.sh
parent6e0839fda3f8598b164a7f23f3eec039e2db5fbc (diff)
kbuild: collect minimum tool versions into scripts/min-tool-version.sh
The kernel build uses various tools, many of which are provided by the same software suite, for example, LLVM and Binutils. When you raise the minimum version of Clang/LLVM, you need to update clang_min_version in scripts/cc-version.sh and also lld_min_version in scripts/ld-version.sh. Kbuild can handle CC=clang and LD=ld.lld independently, but it does not make much sense to maintain their versions separately. Let's create a central place of minimum tool versions so you do not need to touch multiple files. scripts/min-tool-version.sh prints the minimum version of the given tool. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Miguel Ojeda <ojeda@kernel.org> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Diffstat (limited to 'scripts/ld-version.sh')
-rwxr-xr-xscripts/ld-version.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
index 1bf3aadde9de..a78b804b680c 100755
--- a/scripts/ld-version.sh
+++ b/scripts/ld-version.sh
@@ -6,11 +6,6 @@
set -e
-# When you raise the minimum linker version, please update
-# Documentation/process/changes.rst as well.
-bfd_min_version=2.23.0
-lld_min_version=10.0.1
-
# Convert the version string x.y.z to a canonical 5 or 6-digit form.
get_canonical_version()
{
@@ -35,10 +30,12 @@ set -- $(LC_ALL=C "$@" --version)
IFS=' '
set -- $1
+min_tool_version=$(dirname $0)/min-tool-version.sh
+
if [ "$1" = GNU -a "$2" = ld ]; then
shift $(($# - 1))
version=$1
- min_version=$bfd_min_version
+ min_version=$($min_tool_version binutils)
name=BFD
disp_name="GNU ld"
elif [ "$1" = GNU -a "$2" = gold ]; then
@@ -51,7 +48,7 @@ else
if [ "$1" = LLD ]; then
version=$2
- min_version=$lld_min_version
+ min_version=$($min_tool_version llvm)
name=LLD
disp_name=LLD
else