aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2021-09-25 20:58:18 +0200
committerJérôme Forissier <jerome@forissier.org>2021-10-05 15:18:07 +0200
commit0e6830bac421fe73a0338f59529fec2fb0854253 (patch)
tree3f065a5608ff191b74de5db693bf08a8a1cb5810
parent511c7659d6d7581d68421e63cf00d092ff089d10 (diff)
core: move debug info and CC optimization level to config.mk
Move configuration switches CFG_DEBUG_INFO and CFG_CC_OPT_LEVEL default values from arm.mk to config.mk and add a short description. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--core/arch/arm/arm.mk9
-rw-r--r--mk/config.mk12
2 files changed, 12 insertions, 9 deletions
diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk
index d556f54c..5049c114 100644
--- a/core/arch/arm/arm.mk
+++ b/core/arch/arm/arm.mk
@@ -149,17 +149,8 @@ arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only
arm64-platform-cflags-hard-float ?=
arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,)
-ifeq ($(DEBUG),1)
-# For backwards compatibility
-$(call force,CFG_CC_OPT_LEVEL,0)
-$(call force,CFG_DEBUG_INFO,y)
-endif
-
-# Optimize for size by default, usually gives good performance too
-CFG_CC_OPT_LEVEL ?= s
platform-cflags-optimization ?= -O$(CFG_CC_OPT_LEVEL)
-CFG_DEBUG_INFO ?= y
ifeq ($(CFG_DEBUG_INFO),y)
platform-cflags-debug-info ?= -g3
platform-aflags-debug-info ?= -g
diff --git a/mk/config.mk b/mk/config.mk
index 361f7452..46fd1e4f 100644
--- a/mk/config.mk
+++ b/mk/config.mk
@@ -40,6 +40,18 @@ PYTHON3 ?= python3
# Define DEBUG=1 to compile without optimization (forces -O0)
# DEBUG=1
+ifeq ($(DEBUG),1)
+# For backwards compatibility
+$(call force,CFG_CC_OPT_LEVEL,0)
+$(call force,CFG_DEBUG_INFO,y)
+endif
+
+# CFG_CC_OPT_LEVEL sets compiler optimization level passed with -O directive.
+# Optimize for size by default, usually gives good performance too.
+CFG_CC_OPT_LEVEL ?= s
+
+# Enabling CFG_DEBUG_INFO makes debug information embedded in core.
+CFG_DEBUG_INFO ?= y
# If y, enable debug features of the TEE core (assertions and lock checks
# are enabled, panic and assert messages are more verbose, data and prefetch