@@ -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))
@@ -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)
@@ -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
new file mode 100644
@@ -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))