Xtensa port: Let xcc specific make file override unsupported -Og with -O0.

Change-Id: If1a1833b5ce09c7112245b8b73c0ccd28be66c88
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
This commit is contained in:
Mazen NEIFER 2017-01-27 18:46:12 +01:00 committed by Andrew Boie
commit 0efb2313ca
2 changed files with 9 additions and 6 deletions

View file

@ -595,6 +595,12 @@ drivers-y := drivers/
ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
export ARCH
ifeq ($(CONFIG_DEBUG),y)
KBUILD_CFLAGS += -Og
else
KBUILD_CFLAGS += -Os
endif
ifdef ZEPHYR_GCC_VARIANT
include $(srctree)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
else
@ -632,12 +638,6 @@ KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
$(call cc-option,-fno-partial-inlining)
endif
ifeq ($(CONFIG_DEBUG),y)
KBUILD_CFLAGS += -Og
else
KBUILD_CFLAGS += -Os
endif
ifeq ($(CONFIG_STACK_CANARIES),y)
KBUILD_CFLAGS += $(call cc-option,-fstack-protector-all,)
else

View file

@ -71,6 +71,9 @@ KBUILD_CPPFLAGS += -I$(XTENSA_TOOLS_PATH)/lib/xcc/include \
-I${XTENSA_BUILD}/xtensa-elf/include \
-D'__builtin_unreachable()=while(1);'
# xt-xcc does not support -Og, replace with -O0
KBUILD_CFLAGS:=$(patsubst -Og,-O0,${KBUILD_CFLAGS})
# Support for Xtensa simulator from Cadence Design Systems, Inc.
XTRUN=${CROSS_COMPILE}run
XTRUN_FLAGS += --cycle_limit=${XTENSA_ISS_CYCLES_LIMIT}