]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit - Makefile
kbuild: do not call cc-option before KBUILD_CFLAGS initialization
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 12 Oct 2017 09:22:25 +0000 (18:22 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 13 Nov 2017 13:54:24 +0000 (22:54 +0900)
commit433dc2ebe7d17dd21cba7ad5c362d37323592236
tree00de5ce2e441f801d2991c8ef5897a0e11674c6c
parent4e56207130eda9a27df116623e2fce7cca2c6764
kbuild: do not call cc-option before KBUILD_CFLAGS initialization

Some $(call cc-option,...) are invoked very early, even before
KBUILD_CFLAGS, etc. are initialized.

The returned string from $(call cc-option,...) depends on
KBUILD_CPPFLAGS, KBUILD_CFLAGS, and GCC_PLUGINS_CFLAGS.

Since they are exported, they are not empty when the top Makefile
is recursively invoked.

The recursion occurs in several places.  For example, the top
Makefile invokes itself for silentoldconfig.  "make tinyconfig",
"make rpm-pkg" are the cases, too.

In those cases, the second call of cc-option from the same line
runs a different shell command due to non-pristine KBUILD_CFLAGS.

To get the same result all the time, KBUILD_* and GCC_PLUGINS_CFLAGS
must be initialized before any call of cc-option.  This avoids
garbage data in the .cache.mk file.

Move all calls of cc-option below the config targets because target
compiler flags are unnecessary for Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Makefile