When building debug use -Og as the optimization level if its available,
otherwise retain the use of -O0. -Og has been added by GCC to enable all
optimizations that to not affect debugging while retaining full
debugability.

Signed-off-by: Doug Goldstein <car...@cardoe.com>
---
change since v2:
- switch back to cc-option-add to not call cc-option on every invocation
change since v1:
- switch to cc-option to only specify -O0 if -Og isn't supported
---
 tools/Rules.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 9ef0b47..1b79a6e 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -138,6 +138,7 @@ 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)
 # But allow an override to -O0 in case Python enforces -D_FORTIFY_SOURCE=<n>.
 PY_CFLAGS += $(PY_NOOPT_CFLAGS)
 endif
-- 
2.7.3


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

Reply via email to