All of lore.kernel.org
 help / color / mirror / Atom feed
* cc-option in Config.mk and -Og
@ 2016-05-06 15:58 Wei Liu
  2016-05-06 16:00 ` Ian Jackson
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Liu @ 2016-05-06 15:58 UTC (permalink / raw)
  To: Xen-devel; +Cc: Doug Goldstein, Wei Liu, Ian Jackson

Hi,

I discover an issue with cc-option in Config.mk.

# cc-option: Check if compiler supports first option, else fall back to second.                                   
# 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                                                          
# To handle this we do a test compile, passing the option-under-test, on a code                                   
# fragment that will always produce a warning (integer assigned to pointer).                                      
# We then grep for the option-under-test in the compiler's output, the presence
# of which would indicate an "unrecognized command-line option" warning/error.

Doug submitted a patch to use -Og if that option is available, which
contains such line:

 $(call cc-option-add,CFLAGS,CC,-Og)

However the output of -O option is different from what cc-option
expects:

$  echo 'void*p=1;' | gcc -Og -S -o /dev/null -x c -
cc1: error: argument to '-O' should be a non-negative integer

So that it always thinks -Og is supported.

Any thought on how to solve this?

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cc-option in Config.mk and -Og
  2016-05-06 15:58 cc-option in Config.mk and -Og Wei Liu
@ 2016-05-06 16:00 ` Ian Jackson
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Jackson @ 2016-05-06 16:00 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel, Doug Goldstein

Wei Liu writes ("cc-option in Config.mk and -Og"):
>  $(call cc-option-add,CFLAGS,CC,-Og)
> 
> However the output of -O option is different from what cc-option
> expects:

I think cc-option is only suitable for use with warning options.
Sorry for leaving this bear trap.

> Any thought on how to solve this?

cc-option should be renamed to cc-warning-option.

There should be a new macro cc-option which is suitable for things
other than -W[no]-..., and can be simpler.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-06 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-06 15:58 cc-option in Config.mk and -Og Wei Liu
2016-05-06 16:00 ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.