Skip to contentSkip to conversation

build: detect compiler upgrade to rerun kconfig

PATCH In review Anthony PERARD 3 participants 4 messages Mar 26, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: detect compiler upgrade 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.cmd which detects changes of CC_VERSION_TEXT value).

---
 xen/Kconfig  | 2 ++
 xen/Makefile | 4 ++++
 2 files changed, 6 insertions(+)
xen/Kconfig +2 -0
index 073042f46730..4ffa2f90a267 100644
@@ -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
index e5f7b1ae13bc..6dadb3afc119 100644
@@ -277,6 +277,10 @@ $(foreach base,arch/x86/mm/guest_walk_% \
                arch/x86/mm/shadow/guest_%, \
     $(foreach ext,o i s,$(call build-intermediate,$(base).$(ext))))
 
+# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
+# and from include/config/auto.conf.cmd to detect the compiler upgrade.
+export CC_VERSION_TEXT := $(shell $(CC) --version 2>/dev/null | head -n 1)
+
 kconfig := oldconfig config menuconfig defconfig allyesconfig allnoconfig \
 	nconfig xconfig gconfig savedefconfig listnewconfig olddefconfig \
 	randconfig $(notdir $(wildcard arch/$(SRCARCH)/configs/*_defconfig))
Signature · 1 line
Anthony PERARD
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Anthony PERARD

This simple comment allows to detect when $(CC) changes version. Kconfig will be rerun in this case. (Rerun is forced by include/config.auto.cmd which detects changes of CC_VERSION_TEXT value).

I'd suggest s/upgrade/change/ in the subject.  When developing with two different compilers, one half of the transitions will be a downgrade.

#2 lore raw
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Anthony PERARD

This simple comment allows to detect when $(CC) changes version. Kconfig will be rerun in this case. (Rerun is forced by include/config.auto.cmd which detects changes of CC_VERSION_TEXT

:-(, there's a typo here, the path should read
"include/config/auto.conf.cmd".

Quoted 6 lines
Quoted 3 lines

value).

I'd suggest s/upgrade/change/ in the subject.  When developing with two different compilers, one half of the transitions will be a downgrade.

Change of $(CC) is already been taken care of ;-). "upgrade" is what Linux choose to call it but "change" might be ok too.

Quoted 1 line

Thanks,

Signature · 1 line
Anthony PERARD
#3 lore raw
In reply to Anthony PERARD
Quoted 6 lines · Anthony PERARD

This simple comment allows to detect when $(CC) changes version. Kconfig will be rerun in this case. (Rerun is forced by include/config.auto.cmd which detects changes of CC_VERSION_TEXT value).

Well, as said on the other thread, while this is a step forward, it doesn't cover all relevant cases.

Jan