forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Acked-by: Miguel Ojeda <[email protected]> Tested-by: Sedat Dilek <[email protected]>
- Loading branch information
Showing
3 changed files
with
48 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,6 @@ | |
|
||
set -e | ||
|
||
# When you raise the minimum compiler version, please update | ||
# Documentation/process/changes.rst as well. | ||
gcc_min_version=4.9.0 | ||
clang_min_version=10.0.1 | ||
icc_min_version=16.0.3 # temporary | ||
|
||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 | ||
# https://lore.kernel.org/r/[email protected] | ||
if [ "$SRCARCH" = arm64 ]; then | ||
gcc_min_version=5.1.0 | ||
fi | ||
|
||
# Print the compiler name and some version components. | ||
get_compiler_info() | ||
{ | ||
|
@@ -48,18 +36,20 @@ set -- $(get_compiler_info "$@") | |
|
||
name=$1 | ||
|
||
min_tool_version=$(dirname $0)/min-tool-version.sh | ||
|
||
case "$name" in | ||
GCC) | ||
version=$2.$3.$4 | ||
min_version=$gcc_min_version | ||
min_version=$($min_tool_version gcc) | ||
;; | ||
Clang) | ||
version=$2.$3.$4 | ||
min_version=$clang_min_version | ||
min_version=$($min_tool_version llvm) | ||
;; | ||
ICC) | ||
version=$(($2 / 100)).$(($2 % 100)).$3 | ||
min_version=$icc_min_version | ||
min_version=$($min_tool_version icc) | ||
;; | ||
*) | ||
echo "$orig_args: unknown compiler" >&2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
# | ||
# Print the minimum supported version of the given tool. | ||
# When you raise the minimum version, please update | ||
# Documentation/process/changes.rst as well. | ||
|
||
set -e | ||
|
||
if [ $# != 1 ]; then | ||
echo "Usage: $0 toolname" >&2 | ||
exit 1 | ||
fi | ||
|
||
case "$1" in | ||
binutils) | ||
echo 2.23.0 | ||
;; | ||
gcc) | ||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63293 | ||
# https://lore.kernel.org/r/[email protected] | ||
if [ "$SRCARCH" = arm64 ]; then | ||
echo 5.1.0 | ||
else | ||
echo 4.9.0 | ||
fi | ||
;; | ||
icc) | ||
# temporary | ||
echo 16.0.3 | ||
;; | ||
llvm) | ||
echo 10.0.1 | ||
;; | ||
*) | ||
echo "$1: unknown tool" >&2 | ||
exit 1 | ||
;; | ||
esac |