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

[Minios-devel] [UNIKRAFT PATCH 7/9] build: Add a macro to check and add gcc flags for target CPU



In later patches, we will add gcc flags for new added ARM64 CPUs.
We have to check and add flags for each target CPU. So it's better
to add a macro to reduce redundancy Makefile codes.

Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
---
 arch/arm/Makefile.uk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/Makefile.uk b/arch/arm/Makefile.uk
index 780a035..e7f7b49 100644
--- a/arch/arm/Makefile.uk
+++ b/arch/arm/Makefile.uk
@@ -1,3 +1,15 @@
+# define a macro to check the GCC version and add optimization flags
+# for target CPU:
+# $(1): The flag for -march
+# $(2): The flag for -mcpu and -mtune
+# $(3): The minimum GCC major number for target CPU
+# $(4): The minimum GCC minor number for target CPU
+define set_cc_flags =
+$(call check_valid_gcc_version,$(3),$(4),$(2))
+CFLAGS-y   += -march=$(1) -mcpu=$(2) -mtune=$(2)
+CXXFLAGS-y += -march=$(1) -mcpu=$(2) -mtune=$(2)
+endef
+
 # Setup compiler flags and objects for arm32
 ifeq ($(UK_ARCH),arm)
 
-- 
2.7.4


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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