Introduce WITH_TLS_TESTS
Introduces make variable WITH_TLS_TESTS (undefined by default, 'y' to
enable) to select the Thread Local Storage TA tests.
The way TLS is implemented is quite toolchain-specific (compiler, libc)
[1] so it should be enabled only when supported.
Link: [1] https://github.com/OP-TEE/optee_test/commit/30efcbeaf8864d0f2a5c4be593a5411001fab31b
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/ta/os_test/os_test.c b/ta/os_test/os_test.c
index 4329ed4..8670944 100644
--- a/ta/os_test/os_test.c
+++ b/ta/os_test/os_test.c
@@ -1301,6 +1301,7 @@
return res;
}
+#if defined(WITH_TLS_TESTS)
__thread int os_test_tls_a;
__thread int os_test_tls_b = 42;
@@ -1332,6 +1333,17 @@
return TEE_SUCCESS;
}
+#else
+TEE_Result ta_entry_tls_test_main(void)
+{
+ return TEE_ERROR_NOT_SUPPORTED;
+}
+
+TEE_Result ta_entry_tls_test_shlib(void)
+{
+ return TEE_ERROR_NOT_SUPPORTED;
+}
+#endif
static int iterate_hdr_cb(struct dl_phdr_info *info __maybe_unused,
size_t size __unused, void *data)