blob: ffb737d1e37600c98928852704a6dbf438fbc984 [file] [log] [blame]
From c0f9592daae3be17e5fd1528a8f6067cb0c3bd91 Mon Sep 17 00:00:00 2001
From: zijunzhao <zijunzhao@google.com>
Date: Thu, 20 Jan 2022 09:30:51 +0000
Subject: [PATCH] add tsan shared library
Add tsan shared library on Android. Only build tsan when minSdkVersion is above 23.
Reviewed By: danalbert, vitalybuka
Differential Revision: https://reviews.llvm.org/D108394
---
compiler-rt/cmake/config-ix.cmake | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index d196deff5dc1..33693ce60321 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -749,9 +749,14 @@ else()
set(COMPILER_RT_HAS_PROFILE FALSE)
endif()
-if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Darwin|Linux|FreeBSD|Android|NetBSD")
- set(COMPILER_RT_HAS_TSAN TRUE)
+if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH)
+ if (OS_NAME MATCHES "Linux|Darwin|FreeBSD|NetBSD")
+ set(COMPILER_RT_HAS_TSAN TRUE)
+ elseif (OS_NAME MATCHES "Android" AND ANDROID_PLATFORM_LEVEL GREATER 23)
+ set(COMPILER_RT_HAS_TSAN TRUE)
+ else()
+ set(COMPILER_RT_HAS_TSAN FALSE)
+ endif()
else()
set(COMPILER_RT_HAS_TSAN FALSE)
endif()
--
2.35.0.263.gb82422642f-goog