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

[Minios-devel] [UNIKRAFT PATCH 07/13] build: Add a makefile function to check and set flags for valid gcc



Some times, we will add special flags to GCC to do optimization. For
instance, we can use this function to check valid GCC and set flags
to do processors optimization. In order to avoid any definition
clashes, we define this function in support/build/Makefile.rules.

Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
---
 support/build/Makefile.rules | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index 2ac729a..ba6f14d 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -42,6 +42,15 @@ $(if $(call test_gcc_version,$(1),$(2)),,\
      $(error Require GCC version >= $(1).$(2) found 
$(CC_VER_MAJOR).$(CC_VER_MINOR)))
 endef
 
+# set_flags_for_valid_gcc $march,$gcc_major,$gcc_minor,$flags
+define set_flags_for_valid_gcc =
+ifeq ($(1),y)
+$(if $(1),$(call check_valid_gcc_version,$(2),$(3)),)
+CFLAGS-$(1)   += $(4)
+CXXFLAGS-$(1) += $(4)
+endif
+endef
+
 
################################################################################
 #
 # Paths and Filenames
-- 
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®.