diff --git a/compiler-rt/lib/CMakeLists.txt b/compiler-rt/lib/CMakeLists.txt index e0780ccbba87..a3bc3724f57b 100644 --- a/compiler-rt/lib/CMakeLists.txt +++ b/compiler-rt/lib/CMakeLists.txt @@ -7,6 +7,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux") add_subdirectory(interception) add_subdirectory(sanitizer_common) if(NOT ANDROID) + add_subdirectory(lsan) add_subdirectory(profile) add_subdirectory(ubsan) endif() @@ -16,7 +17,6 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID) add_subdirectory(tsan) add_subdirectory(msan) add_subdirectory(msandr) - add_subdirectory(lsan) endif() # The top-level lib directory contains a large amount of C code which provides diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt index 3250dca2a483..064ba1f58034 100644 --- a/compiler-rt/lib/asan/CMakeLists.txt +++ b/compiler-rt/lib/asan/CMakeLists.txt @@ -19,12 +19,10 @@ set(ASAN_SOURCES asan_stack.cc asan_stats.cc asan_thread.cc - asan_win.cc - ) + asan_win.cc) set(ASAN_DYLIB_SOURCES - ${ASAN_SOURCES} - ) + ${ASAN_SOURCES}) include_directories(..) @@ -58,6 +56,7 @@ if(APPLE) SOURCES ${ASAN_DYLIB_SOURCES} $ $ + $ CFLAGS ${ASAN_CFLAGS} DEFS ${ASAN_COMMON_DEFINITIONS} # Dynamic lookup is needed because shadow scale and offset are diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc b/compiler-rt/lib/asan/lit_tests/TestCases/lsan_annotations.cc similarity index 100% rename from compiler-rt/lib/asan/lit_tests/TestCases/Linux/lsan_annotations.cc rename to compiler-rt/lib/asan/lit_tests/TestCases/lsan_annotations.cc diff --git a/compiler-rt/lib/lsan/CMakeLists.txt b/compiler-rt/lib/lsan/CMakeLists.txt index 273b18c0b624..d85f14426947 100644 --- a/compiler-rt/lib/lsan/CMakeLists.txt +++ b/compiler-rt/lib/lsan/CMakeLists.txt @@ -26,7 +26,12 @@ filter_available_targets(LSAN_SUPPORTED_ARCH set(LSAN_RUNTIME_LIBRARIES) -if (NOT APPLE AND NOT ANDROID) +if(APPLE) + add_compiler_rt_osx_object_library(RTLSanCommon + ARCH ${LSAN_COMMON_SUPPORTED_ARCH} + SOURCES ${LSAN_COMMON_SOURCES} + CFLAGS ${LSAN_CFLAGS}) +elseif(NOT ANDROID) foreach(arch ${LSAN_COMMON_SUPPORTED_ARCH}) add_compiler_rt_object_library(RTLSanCommon ${arch} SOURCES ${LSAN_COMMON_SOURCES}