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

Re: [XEN PATCH v3 15/23] xen/build: have the root Makefile generates the CFLAGS



On Thu, Mar 19, 2020 at 04:24:12PM +0000, Anthony PERARD wrote:
> On Tue, Mar 17, 2020 at 06:05:24PM +0000, Anthony PERARD wrote:
> > On Thu, Feb 27, 2020 at 12:05:04PM +0100, Roger Pau Monné wrote:
> > > On Wed, Feb 26, 2020 at 11:33:47AM +0000, Anthony PERARD wrote:
> > > > +ifneq ($(CONFIG_CC_IS_CLANG),y)
> > > > +# Clang doesn't understand this command line argument, and doesn't 
> > > > appear to
> > > > +# have an suitable alternative.  The resulting compiled binary does 
> > > > function,
> > > > +# but has an excessively large symbol table.
> > > > +CFLAGS += -Wa,--strip-local-absolute
> > > 
> > > This is not really related to clang, but to the assembler. If clang is
> > > used with -no-integrated-as it's quite likely that the GNU assembler
> > > will be used, and hence this option would be available.
> > > 
> > > Can we use cc-option-add here in order to detect whether the build
> > > toolchain support the option?
> > 
> > That can be done, but I think I'll do that as a follow up of this patch,
> > to avoid too many changes when moving the cflags around.
> > 
> > > Ideally this should be done after the integrated assembler tests
> > > performed in x86/Rules.mk.
> 
> So, testing for the -Wa,--strip-local-absolute flags turns out to be
> more complicated than I though it would be.
>  - cc-option-add doesn't work because it doesn't test with the current list
>    of CFLAGS. And if I add the CFLAGS, clang says the option is unused,
>    it doesn't matter if -no-integrated-as is present or not.

Oh, that seems like completely bogus clang behavior. It's my
understanding (from reading the manual) that whatever gets appended to
-Wa,<arg> is just passed to the assembler, in which case the compiler
has no idea whether it's used by it or not.

Which version of clang did you use to test it?

Isn't it fine to just attempt to test if it works, and if the compiler
complains just don't append it? (regardless of whether
-no-integrated-as is used or not)

>  - I tried to use as-option macro from Linux but that comes with issues
>    as well. I don't think that enough work as been done to make it work
>    well with clang. (I probably need to filter -Wall out of the CFLAGS
>    when testing, and they are probably other issues.)
> 
> So I think I leave the enhancement for later. Having the flag depends
> on GCC is good enough for now.

Right, until clang adds support for it there's no pressure.

Thanks, Roger.



 


Rackspace

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