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

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


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Fri, 6 Jul 2018 09:03:20 +0000
  • Authentication-results: spf=fail (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Fri, 06 Jul 2018 09:04:28 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/support/build/Makefile.rules b/support/build/Makefile.rules
index f71fd6e..261b8f5 100644
--- a/support/build/Makefile.rules
+++ b/support/build/Makefile.rules
@@ -42,6 +42,14 @@ $(if $(call test_gcc_version,$(1),$(2)),,\
      $(error Require GCC version >= $(1).$(2) found 
$(CC_VER_MAJOR).$(CC_VER_MINOR)))
 endef
 
+# set_flags_if_gcc_version_ge $gcc_major,$gcc_minor,$flags
+define set_flags_if_gcc_version_ge =
+$(call error_if_gcc_version_lt,$(1),$(2))
+ASFLAGS-$(1)  += $(3)
+CFLAGS-$(1)   += $(3)
+CXXFLAGS-$(1) += $(3)
+endef
+
 
################################################################################
 #
 # Paths and Filenames
-- 
2.17.1


_______________________________________________
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®.