[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
Hi Simon, > -----Original Message----- > From: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> > Sent: 2018年6月15日 5:17 > To: Wei Chen <Wei.Chen@xxxxxxx>; minios-devel@xxxxxxxxxxxxxxxxxxxx > Cc: Shijie Huang <Shijie.Huang@xxxxxxx>; Kaly Xin <Kaly.Xin@xxxxxxx>; nd > <nd@xxxxxxx> > Subject: Re: [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? I have included ASFLAGS here, because it hadn't been included in "arch/arm/Makefile.uk" But I think, it should be part here, because here is a common function. And each architecture may have some assembly source code. > 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. In my beginning opinion, I place march as a parameter to reduce lots of if-statement in Makefile. But your concern is more reasonable. This will make the Makefile a little hard to read. I will remove march from the parameter. > > 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |