aboutsummaryrefslogtreecommitdiff
path: root/mk/config.mk
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2019-05-02 13:34:08 +0200
committerJérôme Forissier <jerome.forissier@linaro.org>2019-05-02 17:58:09 +0200
commit70aa7511cf726fa33db715cb819ab586dde6e191 (patch)
tree09c4fcde3b9ae953c6ad475f2daab5e49b0e0069 /mk/config.mk
parent5c151b7e2c3f4414bb41d71005c6b30a58d3fe5c (diff)
Error out if CFG_TA_GPROF_SUPPORT and CFG_ULIBS_SHARED are both enabled
The gprof sample buffer is currently allocated at link time by the TA linker script: ta/arch/arm/ta.ld.S. The size of the buffer is a function of the total TA code size (.text segment). While this works fine for statically linked TAs, it is problematic when shared libraries are used, because in this case the total .text size is not known at link time. As a result, the pre-allocated buffer may be too small, resulting in the following error when the TA is initialized: E/TA: __utee_gprof_init:159 gprof: could not allocate profiling buffer One way to fix this problem is to allocate the buffer at run time, once all the shared libraries have been loaded. Since the TA loader is about to be reworked and moved to user space, let's wait for this to occur before implementing a long term solution. This commit just prohibits the problematic configuration in mk/config.mk. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'mk/config.mk')
-rw-r--r--mk/config.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/mk/config.mk b/mk/config.mk
index ec75bfb4..e7ea01c4 100644
--- a/mk/config.mk
+++ b/mk/config.mk
@@ -370,6 +370,19 @@ endif
# in the same way as TAs so that they can be found at runtime.
CFG_ULIBS_SHARED ?= n
+ifeq (yy,$(CFG_TA_GPROF_SUPPORT)$(CFG_ULIBS_SHARED))
+# FIXME:
+# TA profiling with gprof does not work well with shared libraries (not limited
+# to CFG_ULIBS_SHARED=y actually), because the total .text size is not known at
+# link time. The symptom is an error trace when the TA starts (and no gprof
+# output is produced):
+# E/TA: __utee_gprof_init:159 gprof: could not allocate profiling buffer
+# The allocation of the profiling buffer should probably be done at runtime
+# via a new syscall/PTA call instead of having it pre-allocated in .bss by the
+# linker.
+$(error CFG_TA_GPROF_SUPPORT and CFG_ULIBS_SHARED are currently incompatible)
+endif
+
# CFG_GP_SOCKETS
# Enable Global Platform Sockets support
CFG_GP_SOCKETS ?= y