aboutsummaryrefslogtreecommitdiff
path: root/ta
diff options
context:
space:
mode:
Diffstat (limited to 'ta')
-rw-r--r--ta/mk/ta_dev_kit.mk7
-rw-r--r--ta/ta.mk2
2 files changed, 9 insertions, 0 deletions
diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
index a717bbdf..c7506dbb 100644
--- a/ta/mk/ta_dev_kit.mk
+++ b/ta/mk/ta_dev_kit.mk
@@ -53,6 +53,13 @@ cflags$(sm) := $($(sm)-platform-cflags) $(CFLAGS_$(sm))
CFG_TEE_TA_LOG_LEVEL ?= 2
cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)
+ifeq ($(CFG_TEE_TA_MALLOC_DEBUG),y)
+# TAs will automatically use debug versions of the malloc() functions
+# in libutils (malloc() will be re-defined as mdbg_malloc() etc.).
+# mdbg_check() will also be visible.
+cppflags$(sm) += -DENABLE_MDBG=1
+endif
+
cppflags$(sm) += -I. -I$(ta-dev-kit-dir)/include
libdirs += $(ta-dev-kit-dir)/lib
diff --git a/ta/ta.mk b/ta/ta.mk
index 57c4fe7a..7f42123b 100644
--- a/ta/ta.mk
+++ b/ta/ta.mk
@@ -19,6 +19,8 @@ cppflags$(sm) += -include $(conf-file)
# Config flags from mk/config.mk
cppflags$(sm) += -DTRACE_LEVEL=$(CFG_TEE_TA_LOG_LEVEL)
ifeq ($(CFG_TEE_TA_MALLOC_DEBUG),y)
+# Build malloc debug code into libutils: (mdbg_malloc(), mdbg_free(),
+# mdbg_check(), etc.).
cppflags$(sm) += -DENABLE_MDBG=1
endif