xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] tools: detect appropriate debug optimization level
@ 2016-04-26 14:38 Doug Goldstein
  2016-04-28 10:57 ` Wei Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Doug Goldstein @ 2016-04-26 14:38 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Ian Jackson, Doug Goldstein

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 <cardoe@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

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

end of thread, other threads:[~2018-03-12 16:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26 14:38 [PATCH v3] tools: detect appropriate debug optimization level Doug Goldstein
2016-04-28 10:57 ` Wei Liu
2016-04-28 17:19 ` Ian Jackson
2016-04-28 17:22   ` Wei Liu
2016-04-28 17:40 ` Wei Liu
2018-02-24  5:26   ` Doug Goldstein
2018-03-02 12:46     ` Wei Liu
2018-03-11  5:08       ` Doug Goldstein
2018-03-12 16:16         ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).