diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-04-23 23:23:52 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2020-05-12 13:28:33 +0900 |
commit | 8b59cd81dc5e724eaea283fa6006985891c7bff4 (patch) | |
tree | fb5f5ffbfb4f6e27a951a122e0b262439ccd1177 /include | |
parent | e33ae3ed331a5cfa24b2abe483f7f4b27bb99c06 (diff) | |
download | linux-stable-8b59cd81dc5e724eaea283fa6006985891c7bff4.tar.gz linux-stable-8b59cd81dc5e724eaea283fa6006985891c7bff4.tar.bz2 linux-stable-8b59cd81dc5e724eaea283fa6006985891c7bff4.zip |
kbuild: ensure full rebuild when the compiler is updated
Commit 21c54b774744 ("kconfig: show compiler version text in the top
comment") added the environment variable, CC_VERSION_TEXT in the comment
of the top Kconfig file. It can detect the compiler update, and invoke
the syncconfig because all environment variables referenced in Kconfig
files are recorded in include/config/auto.conf.cmd
This commit makes it a CONFIG option in order to ensure the full rebuild
when the compiler is updated.
This works like follows:
include/config/kconfig.h contains "CONFIG_CC_VERSION_TEXT" in the comment
block.
The top Makefile specifies "-include $(srctree)/include/linux/kconfig.h"
to guarantee it is included from all kernel source files.
fixdep parses every source file and all headers included from it,
searching for words prefixed with "CONFIG_". Then, fixdep finds
CONFIG_CC_VERSION_TEXT in include/config/kconfig.h and adds
include/config/cc/version/text.h into every .*.cmd file.
When the compiler is updated, syncconfig is invoked because init/Kconfig
contains the reference to the environment variable CC_VERTION_TEXT.
CONFIG_CC_VERSION_TEXT is updated to the new version string, and
include/config/cc/version/text.h is touched.
In the next rebuild, Make will rebuild every files since the timestamp
of include/config/cc/version/text.h is newer than that of target.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kconfig.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index cc8fa109cfa3..9d12c970f18f 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h @@ -2,6 +2,8 @@ #ifndef __LINUX_KCONFIG_H #define __LINUX_KCONFIG_H +/* CONFIG_CC_VERSION_TEXT (Do not delete this comment. See help in Kconfig) */ + #include <generated/autoconf.h> #ifdef CONFIG_CPU_BIG_ENDIAN |