build: make debug option affect tools only
authorWei Liu <wei.liu2@citrix.com>
Mon, 31 Oct 2016 17:42:25 +0000 (17:42 +0000)
committerWei Liu <wei.liu2@citrix.com>
Thu, 3 Nov 2016 10:40:39 +0000 (10:40 +0000)
commit31d41d7bc87d0d2a24ac965b37793faa40d23dcb
treecd1ec1e7bc5d220d2c1d80fc3f3f31fad704bfa9
parente1d1c68ea8a3354ba7474f15303d0a9086ba3287
build: make debug option affect tools only

The debug option in Config.mk affects hypervisor, tools and stubdom by
appending different flags to CFLAGS.  Mini-os under extra is not
affected because it already has its own build system when it is
separated from xen.git.

It is undesirable because now hypervisor build is affected by both
Kconfig and debug.

Disentangle the semantics of debug by pushing relevant options to
individual sub-systems.

For hypervisor, the flags previously added by debug option is now
controlled by CONFIG_DEBUG.

For tools, flags are moved from config/*.mk into tools/Rules.mk.

For stubdom, because it unilaterally sets debug=y before including
top-level Config.mk, we only need to move the debug build set of flags
into stubdom Makefile.

Specifically there are some considerations on what flags are picked:

1. we don't need -fno-optimize-sibling-calls anymore because gcc doc
   indicates that it is not enabled for -O1, which we already set in the
   debug build.
2. for tools we use -O0 -g3 in Rules.mk because they already take
   precedence over the flags set in config/*.mk.
3. for hypervisor we don't add -fno-omit-frame-pointer to debug build
   because that's controlled by CONFIG_FRAME_POINTER.

This patch doesn't intend to tune those flags, but to provide identical
set of effective flags as before.  The debug option in Config.mk will
only affect tools components after this patch is applied.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
config/StdGNU.mk
config/SunOS.mk
stubdom/Makefile
tools/Rules.mk
xen/Rules.mk