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

Re: [Xen-devel] [PATCH 2/2] tools: detect appropriate debug optimization level



On Mon, Mar 07, 2016 at 08:23:40PM -0600, Doug Goldstein wrote:
> The build should not use -O0 as that results in miscompilations. There

This needs some (concrete) references. Is that a known issue in gcc? If
so can you reference the bug number?

> have been a few instances on the ML where users were told to switch
> from -O0 to -O1 or -O2 or to set debug=n and their issue went away. The
> preferred route should be to use -Og if its available, otherwise use
> -O1 which is the default. This change undoes the change from -O1 to -O0

gcc manual says -O0 is the default.

Not that I disagree with this patch in general, but the commit message
seems a bit misleading.

> in 1166ecf781b1016eaa61f8d5ba4fb1fde9d599b6.
> 

And I have no idea why -O1 confuses the debugger so I've CC'ed Euan for
more input.

> Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
> ---
> CC: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> CC: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
>  tools/Rules.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/Rules.mk b/tools/Rules.mk
> index 9ef0b47..ae6b01f 100644
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -137,7 +137,8 @@ SHLIB_libxenvchan  = $(SHDEPS_libxenvchan) 
> -Wl,-rpath-link=$(XEN_LIBVCHAN)
>  
>  ifeq ($(debug),y)
>  # Disable optimizations and enable debugging information for macros
> -CFLAGS += -O0 -g3
> +$(call cc-option-add,CFLAGS,CC,-Og)
> +CFLAGS += -g3
>  # But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=<n>.
>  PY_CFLAGS += $(PY_NOOPT_CFLAGS)
>  endif
> -- 
> 2.4.10
> 

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

 


Rackspace

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