[compiler-rt] r246227 - [CMake] Unify build rules for sanitizer_common for Apple and non-Apple platforms.
Alexey Samsonov via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 15:23:27 PDT 2015
Author: samsonov
Date: Thu Aug 27 17:23:27 2015
New Revision: 246227
URL: http://llvm.org/viewvc/llvm-project?rev=246227&view=rev
Log:
[CMake] Unify build rules for sanitizer_common for Apple and non-Apple platforms.
Additionally, link safestack runtime on OS X with nolibc version of
sanitizer_common runtime, as we do on Linux.
Modified:
compiler-rt/trunk/lib/asan/CMakeLists.txt
compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
compiler-rt/trunk/lib/safestack/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/trunk/lib/ubsan/CMakeLists.txt
Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=246227&r1=246226&r2=246227&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Thu Aug 27 17:23:27 2015
@@ -113,6 +113,7 @@ if(APPLE)
OBJECT_LIBS RTAsan_dynamic
RTInterception
RTSanitizerCommon
+ RTSanitizerCommonLibc
RTLSanCommon
RTUbsan
CFLAGS ${ASAN_DYNAMIC_CFLAGS}
Modified: compiler-rt/trunk/lib/asan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/CMakeLists.txt?rev=246227&r1=246226&r2=246227&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/tests/CMakeLists.txt Thu Aug 27 17:23:27 2015
@@ -220,6 +220,7 @@ macro(add_asan_tests_for_arch_and_kind a
$<TARGET_OBJECTS:RTAsan_dynamic.osx>
$<TARGET_OBJECTS:RTInterception.osx>
$<TARGET_OBJECTS:RTSanitizerCommon.osx>
+ $<TARGET_OBJECTS:RTSanitizerCommonLibc.osx>
$<TARGET_OBJECTS:RTLSanCommon.osx>
$<TARGET_OBJECTS:RTUbsan.osx>)
else()
Modified: compiler-rt/trunk/lib/safestack/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/safestack/CMakeLists.txt?rev=246227&r1=246226&r2=246227&view=diff
==============================================================================
--- compiler-rt/trunk/lib/safestack/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/safestack/CMakeLists.txt Thu Aug 27 17:23:27 2015
@@ -15,6 +15,7 @@ if(APPLE)
SOURCES ${SAFESTACK_SOURCES}
$<TARGET_OBJECTS:RTInterception.osx>
$<TARGET_OBJECTS:RTSanitizerCommon.osx>
+ $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.osx>
CFLAGS ${SAFESTACK_CFLAGS}
PARENT_TARGET safestack)
else()
Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=246227&r1=246226&r2=246227&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Thu Aug 27 17:23:27 2015
@@ -130,31 +130,28 @@ append_list_if(COMPILER_RT_HAS_WGLOBAL_C
SANITIZER_CFLAGS)
if(APPLE)
- # Build universal binary on APPLE.
-
- add_compiler_rt_object_libraries(RTSanitizerCommon
- OS ${SANITIZER_COMMON_SUPPORTED_OS}
- ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
- SOURCES ${SANITIZER_SOURCES} ${SANITIZER_LIBCDEP_SOURCES}
- CFLAGS ${SANITIZER_CFLAGS}
- DEFS ${SANITIZER_COMMON_DEFINITIONS})
-else()
- # Otherwise, build separate libraries for each target.
-
- add_compiler_rt_object_libraries(RTSanitizerCommon
- ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
- SOURCES ${SANITIZER_SOURCES} CFLAGS ${SANITIZER_CFLAGS}
- DEFS ${SANITIZER_COMMON_DEFINITIONS})
- add_compiler_rt_object_libraries(RTSanitizerCommonNoLibc
- ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
- SOURCES ${SANITIZER_NOLIBC_SOURCES} CFLAGS ${SANITIZER_CFLAGS}
- DEFS ${SANITIZER_COMMON_DEFINITIONS})
- add_compiler_rt_object_libraries(RTSanitizerCommonLibc
- ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
- SOURCES ${SANITIZER_LIBCDEP_SOURCES} CFLAGS ${SANITIZER_CFLAGS}
- DEFS ${SANITIZER_COMMON_DEFINITIONS})
+ set(OS_OPTION OS ${SANITIZER_COMMON_SUPPORTED_OS})
endif()
+add_compiler_rt_object_libraries(RTSanitizerCommon
+ ${OS_OPTION}
+ ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
+ SOURCES ${SANITIZER_SOURCES}
+ CFLAGS ${SANITIZER_CFLAGS}
+ DEFS ${SANITIZER_COMMON_DEFINITIONS})
+add_compiler_rt_object_libraries(RTSanitizerCommonNoLibc
+ ${OS_OPTION}
+ ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
+ SOURCES ${SANITIZER_NOLIBC_SOURCES}
+ CFLAGS ${SANITIZER_CFLAGS}
+ DEFS ${SANITIZER_COMMON_DEFINITIONS})
+add_compiler_rt_object_libraries(RTSanitizerCommonLibc
+ ${OS_OPTION}
+ ARCHS ${SANITIZER_COMMON_SUPPORTED_ARCH}
+ SOURCES ${SANITIZER_LIBCDEP_SOURCES}
+ CFLAGS ${SANITIZER_CFLAGS}
+ DEFS ${SANITIZER_COMMON_DEFINITIONS})
+
# Unit tests for common sanitizer runtime.
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=246227&r1=246226&r2=246227&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Thu Aug 27 17:23:27 2015
@@ -171,7 +171,8 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS AND NOT
# be sure that produced binaries would work.
if(APPLE)
add_sanitizer_common_lib("RTSanitizerCommon.test.osx"
- $<TARGET_OBJECTS:RTSanitizerCommon.osx>)
+ $<TARGET_OBJECTS:RTSanitizerCommon.osx>
+ $<TARGET_OBJECTS:RTSanitizerCommonLibc.osx>)
else()
if(CAN_TARGET_x86_64)
add_sanitizer_common_lib("RTSanitizerCommon.test.nolibc.x86_64"
Modified: compiler-rt/trunk/lib/ubsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/CMakeLists.txt?rev=246227&r1=246226&r2=246227&view=diff
==============================================================================
--- compiler-rt/trunk/lib/ubsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/ubsan/CMakeLists.txt Thu Aug 27 17:23:27 2015
@@ -57,6 +57,7 @@ if(APPLE)
OBJECT_LIBS RTUbsan
RTUbsan_standalone
RTSanitizerCommon
+ RTSanitizerCommonLibc
PARENT_TARGET ubsan)
endif()
More information about the llvm-commits
mailing list