[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] xen: Import cc-ifversion from Kbuild



commit 4c91ad721c80d497fde6740a9f957f66ecff2267
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Wed Dec 4 17:13:51 2019 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jan 30 11:54:33 2020 +0000

    xen: Import cc-ifversion from Kbuild
    
    This is in preparation of importing Kbuild to build Xen. We won't be
    able to include Config.mk so we will need a replacement for the macro
    `cc-ifversion'.
    
    This patch imports parts of "scripts/Kbuild.include" from Linux v5.4,
    the macro cc-ifversion. It makes use of CONFIG_GCC_VERSION that
    Kconfig now provides.
    
    Since they are no other use of Xen's `cc-ifversion' macro, we can
    remove it.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 Config.mk                    | 5 -----
 xen/Rules.mk                 | 1 +
 xen/common/coverage/Makefile | 8 ++++----
 xen/scripts/Kbuild.include   | 7 +++++++
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/Config.mk b/Config.mk
index 35d66e5e12..65649d6122 100644
--- a/Config.mk
+++ b/Config.mk
@@ -121,11 +121,6 @@ define cc-ver-check-closure
     endif
 endef
 
-# cc-ifversion: Check compiler version and take branch accordingly
-# Usage $(call cc-ifversion,lt,0x040700,string_if_y,string_if_n)
-cc-ifversion = $(shell [ $(call cc-ver,$(CC),$(1),$(2)) = "y" ] \
-                               && echo $(3) || echo $(4))
-
 # Require GCC v4.1+
 check-$(gcc) = $(call cc-ver-check,CC,0x040100,"Xen requires at least gcc-4.1")
 $(eval $(check-y))
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 8dc044a357..2bd269bb8a 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -2,6 +2,7 @@
 -include $(BASEDIR)/include/config/auto.conf
 
 include $(XEN_ROOT)/Config.mk
+include $(BASEDIR)/scripts/Kbuild.include
 
 
 ifneq ($(origin crash_debug),undefined)
diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile
index 46c78d1086..b509e51f96 100644
--- a/xen/common/coverage/Makefile
+++ b/xen/common/coverage/Makefile
@@ -1,10 +1,10 @@
 obj-y += coverage.o
 ifneq ($(clang),y)
 obj-y += gcov_base.o gcov.o
-obj-y += $(call cc-ifversion,lt,0x040700, \
-               gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
-               gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
-               gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
+obj-y += $(call cc-ifversion,-lt,0407, \
+               gcc_3_4.o, $(call cc-ifversion,-lt,0409, \
+               gcc_4_7.o, $(call cc-ifversion,-lt,0500, \
+               gcc_4_9.o, $(call cc-ifversion,-lt,0700, \
                gcc_5.o, gcc_7.o))))
 else
 obj-y += llvm.o
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
new file mode 100644
index 0000000000..a5c462fd97
--- /dev/null
+++ b/xen/scripts/Kbuild.include
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0
+####
+# kbuild: Generic definitions
+
+# cc-ifversion
+# Usage:  EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
+cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || 
echo $(4))
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.