xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [XEN PATCH v2] build: detect compiler change to rerun kconfig
@ 2023-03-20 15:28 Anthony PERARD
  2023-03-22 14:13 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony PERARD @ 2023-03-20 15:28 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, Wei Liu

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).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---

Technically, it was acked by Andrew:
    https://lore.kernel.org/xen-devel/20200326135621.687685-1-anthony.perard@citrix.com/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(+)

diff --git a/xen/Kconfig b/xen/Kconfig
index 134e6e68ad..756c7842e9 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -4,6 +4,8 @@
 #
 mainmenu "Xen/$(SRCARCH) $(XEN_FULLVERSION) Configuration"
 
+comment "Compiler: $(CC_VERSION_TEXT)"
+
 source "scripts/Kconfig.include"
 
 config BROKEN
diff --git a/xen/Makefile b/xen/Makefile
index 2710d7327e..12c6891a79 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -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
-- 
Anthony PERARD



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [XEN PATCH v2] build: detect compiler change to rerun kconfig
  2023-03-20 15:28 [XEN PATCH v2] build: detect compiler change to rerun kconfig Anthony PERARD
@ 2023-03-22 14:13 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2023-03-22 14:13 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: Andrew Cooper, George Dunlap, Julien Grall, Stefano Stabellini,
	Wei Liu, xen-devel

On 20.03.2023 16:28, Anthony PERARD wrote:
> 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).
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> 
> Technically, it was acked by Andrew:
>     https://lore.kernel.org/xen-devel/20200326135621.687685-1-anthony.perard@citrix.com/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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-22 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 15:28 [XEN PATCH v2] build: detect compiler change to rerun kconfig Anthony PERARD
2023-03-22 14:13 ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).