summaryrefslogtreecommitdiff
path: root/Documentation/kbuild/makefiles.txt
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-03-01 16:10:21 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-03-04 22:34:59 +0900
commitd3a918c659ed0998ac668de3973e81bab81dde74 (patch)
tree31f247bad04c26b04ed824cec7d3ada47d2bba1e /Documentation/kbuild/makefiles.txt
parent00250b52190bc30fb83ea464d9e921b53c07aaa1 (diff)
downloadlwn-d3a918c659ed0998ac668de3973e81bab81dde74.tar.gz
lwn-d3a918c659ed0998ac668de3973e81bab81dde74.zip
kbuild: remove cc-version macro
There is no more direct user of this macro; it is only used by cc-ifversion. Calling this macro is not efficient since it invokes the compiler to get the compiler version. CONFIG_GCC_VERSION is already calculated in the Kconfig stage, so Makefile can reuse it. Here is a note about the slight difference between cc-version and CONFIG_GCC_VERSION: When using Clang, cc-version is evaluated to '0402' because Clang defines __GNUC__ and __GNUC__MINOR__, and looks like GCC 4.2 in the version point of view. On the other hand, CONFIG_GCC_VERSION=0 when $(CC) is clang. There are currently two users of cc-ifversion: arch/mips/loongson64/Platform arch/powerpc/Makefile They are not affected by this change. The format of cc-version is <major><minor>, while CONFIG_GCC_VERSION <major><minor><patch>. I adjusted cc-ifversion for the difference of the number of digits. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Documentation/kbuild/makefiles.txt')
-rw-r--r--Documentation/kbuild/makefiles.txt17
1 files changed, 0 insertions, 17 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 48eab0bb1183..f124be6e4c3a 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -499,23 +499,6 @@ more details, with real examples.
In the above example, -Wno-unused-but-set-variable will be added to
KBUILD_CFLAGS only if gcc really accepts it.
- cc-version
- cc-version returns a numerical version of the $(CC) compiler version.
- The format is <major><minor> where both are two digits. So for example
- gcc 3.41 would return 0341.
- cc-version is useful when a specific $(CC) version is faulty in one
- area, for example -mregparm=3 was broken in some gcc versions
- even though the option was accepted by gcc.
-
- Example:
- #arch/x86/Makefile
- cflags-y += $(shell \
- if [ $(cc-version) -ge 0300 ] ; then \
- echo "-mregparm=3"; fi ;)
-
- In the above example, -mregparm=3 is only used for gcc version greater
- than or equal to gcc 3.0.
-
cc-ifversion
cc-ifversion tests the version of $(CC) and equals the fourth parameter
if version expression is true, or the fifth (if given) if the version