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

Re: [Xen-devel] Implementaiton of cc-option in Config.mk



>>> On 14.03.18 at 18:11, <wei.liu2@xxxxxxxxxx> wrote:
> The implementation of cc-option (grepping the option being tested in
> output) in Config.mk now makes it not possible to detect if -Og is
> supported because "-Og" doesn't appear in the output if it is not
> supported. I suspect there will be other options that cc-option can't work
> with.
> 
> It is implemented like that because we try to detect -Wno-* option. But
> why is that important? Can't we just ignore -Wno-* if they aren't
> supported?

Well, the explanation for its behavior is given in the comment
next to its definition:

# This is complicated by the fact that unrecognised -Wno-* options:
#   (a) are ignored unless the compilation emits a warning; and
#   (b) even then produce a warning rather than an error

> Does anyone has an idea how to make cc-option work for -Og
> (and other options)?

How about simply extending it to also use the "test failed"
alternative if the compilation produced an error status (which
is currently ignored by way of the use of a pipeline)? Untested:

cc-option = $(shell if test -z "`echo 'void*p=1;' | \
              { $(1) $(2) -S -o /dev/null -x c - 2>&1 || echo $(2); } | grep -- 
$(2) -`"; \
              then echo "$(2)"; else echo "$(3)"; fi ;)

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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