From ff5e6c2f2edb661ff251198fc8464ead6f9c6afb Mon Sep 17 00:00:00 2001 From: Karl Koscher Date: Mon, 9 May 2022 22:58:31 -0700 Subject: [PATCH] Fix running gtest on Hexagon hardware --- tests/cpp-runtime/hexagon/run_all_tests.cc | 8 ++++++++ tests/scripts/task_build_hexagon_api.sh | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/cpp-runtime/hexagon/run_all_tests.cc b/tests/cpp-runtime/hexagon/run_all_tests.cc index 166d89b63566..720249d9d921 100644 --- a/tests/cpp-runtime/hexagon/run_all_tests.cc +++ b/tests/cpp-runtime/hexagon/run_all_tests.cc @@ -26,6 +26,14 @@ #include "../src/support/utils.h" +// Workaround for missing symbol in some QuRT builds +#include "qurt.h" +extern "C" { +__attribute__((weak)) int pthread_key_delete(pthread_key_t key) { + return qurt_tls_delete_key((int)key); +} +} + namespace tvm { namespace runtime { namespace hexagon { diff --git a/tests/scripts/task_build_hexagon_api.sh b/tests/scripts/task_build_hexagon_api.sh index 5a6a859ef1a5..a3b501d9c554 100755 --- a/tests/scripts/task_build_hexagon_api.sh +++ b/tests/scripts/task_build_hexagon_api.sh @@ -43,8 +43,7 @@ cmake -DANDROID_ABI=arm64-v8a \ -DUSE_HEXAGON_ARCH=v68 \ -DUSE_HEXAGON_SDK="${HEXAGON_SDK_PATH}" \ -DUSE_HEXAGON_TOOLCHAIN="${HEXAGON_TOOLCHAIN}" \ - -DUSE_OUTPUT_BINARY_DIR="${output_binary_directory}" .. - # TODO(hexagon-team): enable this once https://github.com/apache/tvm/issues/11237 is fixed. - # -DUSE_HEXAGON_GTEST="${HEXAGON_SDK_PATH}/utils/googletest/gtest" .. + -DUSE_OUTPUT_BINARY_DIR="${output_binary_directory}" \ + -DUSE_HEXAGON_GTEST="${HEXAGON_SDK_PATH}/utils/googletest/gtest" .. make -j$(nproc)