Files
xen/config/StdGNU.mk
T
Wei Liu 31d41d7bc8 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>
2016-11-03 10:40:39 +00:00

42 lines
975 B
Makefile

AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
ifeq ($(clang),y)
CC = $(CROSS_COMPILE)clang
CXX = $(CROSS_COMPILE)clang++
LD_LTO = $(CROSS_COMPILE)llvm-ld
else
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
LD_LTO = $(CROSS_COMPILE)ld
endif
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
RANLIB = $(CROSS_COMPILE)ranlib
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
SIZEUTIL = $(CROSS_COMPILE)size
# Allow git to be wrappered in the environment
GIT ?= git
INSTALL = install
INSTALL_DIR = $(INSTALL) -d -m0755 -p
INSTALL_DATA = $(INSTALL) -m0644 -p
INSTALL_PROG = $(INSTALL) -m0755 -p
BOOT_DIR ?= /boot
DEBUG_DIR ?= /usr/lib/debug
SOCKET_LIBS =
UTIL_LIBS = -lutil
SONAME_LDFLAG = -soname
SHLIB_LDFLAGS = -shared
ifeq ($(lto),y)
CFLAGS += -flto
LDFLAGS-$(clang) += -plugin LLVMgold.so
endif