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

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





On 16.04.2018 11:07, Wei Chen wrote:
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
+

What about ASFLAGS? Shouldn't they also be part here?
Together with the suggested scheme from patch 6 we could call this function `set_flags_if_gcc_version_ge`. Do you really want to make march as part of the arguments? I would actually in the file where you use this function surround it with the if-statement. It is probably easier to read and to understand.

Sorry that I did not reply earlier to your suggestion of your first series.

  
################################################################################
  #
  # Paths and Filenames


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