build: detect compiler change to rerun kconfig
PATCH v2 1/1 build: detect compiler change to rerun kconfig
This simple comment allows to detect when $(CC) changes version. Kconfig will be rerun in this case. (Rerun is forced by include/config/auto.conf.cmd which detects changes of CC_VERSION_TEXT value).
---
Technically, it was acked by Andrew:
https://lore.kernel.org/xen-devel/[email protected]/t/#ma1171775b9938bcdffc80b2fcb8d2a883cd3e32a
v2:
- s/upgrade/change/ in subject and in the comment in the Makefile
- Fix path in commit description
--- xen/Kconfig | 2 ++ xen/Makefile | 4 ++++ 2 files changed, 6 insertions(+)
xen/Kconfig +2 -0
@@ -4,6 +4,8 @@ # mainmenu "Xen/$(SRCARCH) $(XEN_FULLVERSION) Configuration" +comment "Compiler: $(CC_VERSION_TEXT)" + source "scripts/Kconfig.include" config BROKEN
xen/Makefile +4 -0
@@ -326,6 +326,10 @@ ifdef building_out_of_srctree { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore endif +# CC_VERSION_TEXT is referenced from Kconfig (so it needs export), +# and from include/config/auto.conf.cmd to detect the compiler change. +export CC_VERSION_TEXT := $(shell $(CC) --version 2>/dev/null | head -n 1) + ifeq ($(config-build),y) # =========================================================================== # *config targets only - make sure prerequisites are updated, and descend
Signature · 1 line
Anthony PERARD
Quoted 10 lines · Anthony PERARD
This simple comment allows to detect when $(CC) changes version.
Kconfigwill be rerun in this case. (Rerun is forced byinclude/config/auto.conf.cmdwhich detects changes ofCC_VERSION_TEXTvalue).Signed-off-by Anthony PERARD <[email protected]>---
Technically, it was acked by Andrew:
https://lore.kernel.org/xen-devel/[email protected]/t/#ma1171775b9938bcdffc80b2fcb8d2a883cd3e32a
And technically - comment visible under the same link - this still isn't what we would need to address one of the arguments around not storing tool chain capabilities in .config: The version string may not change, but an update may still have brought a new option the compiler understands (or a downgrade may have taken away one). In fact this change is working against the proposed direction of not making .config contents dependent upon tool chain properties. But of course that proposal wasn't adopted yet, so for the time being this still looks to be an improvement.
Jan
Quoted 12 lines · Jan Beulich
Quoted 10 lines · Anthony PERARD
This simple comment allows to detect when $(CC) changes version.
Kconfigwill be rerun in this case. (Rerun is forced byinclude/config/auto.conf.cmdwhich detects changes ofCC_VERSION_TEXTvalue).Signed-off-by Anthony PERARD <[email protected]>---
Technically, it was acked by Andrew:
https://lore.kernel.org/xen-devel/[email protected]/t/#ma1171775b9938bcdffc80b2fcb8d2a883cd3e32a
Quoted 9 lines
And technically - comment visible under the same link - this still isn't what we would need to address one of the arguments around not storing tool chain capabilities in .config: The version string may not change, but an update may still have brought a new option the compiler understands (or a downgrade may have taken away one). In fact this change is working against the proposed direction of not making .config contents dependent upon tool chain properties. But of course that proposal wasn't adopted yet, so for the time being this still looks to be an improvement.
Coming back to this, seeing that there's unlikely to be any better approach any time soon, can we perhaps get this in then, ideally with $(LD) and the assembler backing the compiler (we don't use $(AS) anywhere, so we'd need to use e.g. "$$($(CC) -print-prog-name as) --version") also checked?
Jan