]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: remove cc-version macro
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 1 Mar 2019 07:10:21 +0000 (16:10 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 4 Mar 2019 13:34:59 +0000 (22:34 +0900)
commit505c9d76c715a1ed04bfd19153c4fe72ddb82645
tree31f247bad04c26b04ed824cec7d3ada47d2bba1e
parent00c75a12f3ddb2d0c9177d3d28ec1dc1132848b3
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>
Documentation/kbuild/makefiles.txt
scripts/Kbuild.include