From aadef6c1689014e4f9d374d4f19e4edb80b86ab2 Mon Sep 17 00:00:00 2001 From: dhy308 Date: Mon, 26 Sep 2022 12:06:51 +0800 Subject: [PATCH] fix issues after enabling emutls feature Signed-off-by: dhy308 --- compiler-rt/lib/builtins/emutls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/builtins/emutls.c b/compiler-rt/lib/builtins/emutls.c index 98cabd917d6c..e90225e8ac29 100644 --- a/compiler-rt/lib/builtins/emutls.c +++ b/compiler-rt/lib/builtins/emutls.c @@ -12,7 +12,7 @@ #include "int_lib.h" -#ifdef __BIONIC__ +#if defined(__BIONIC__) || defined(__OHOS__) // There are 4 pthread key cleanup rounds on Bionic. Delay emutls deallocation // to round 2. We need to delay deallocation because: // - Android versions older than M lack __cxa_thread_atexit_impl, so apps @@ -382,7 +382,7 @@ void *__emutls_get_address(__emutls_control *control) { return array->data[index]; } -#ifdef __BIONIC__ +#if defined(__BIONIC__) || defined(__OHOS__) // Called by Bionic on dlclose to delete the emutls pthread key. __attribute__((visibility("hidden"))) void __emutls_unregister_key(void) { if (emutls_key_created) { -- Gitee