[llvm-commits] [compiler-rt] r162675 - in /compiler-rt/trunk: CMakeLists.txt lib/asan/CMakeLists.txt lib/interception/CMakeLists.txt lib/sanitizer_common/CMakeLists.txt
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Mon Aug 27 07:28:27 PDT 2012
Author: eugenis
Date: Mon Aug 27 09:28:27 2012
New Revision: 162675
URL: http://llvm.org/viewvc/llvm-project?rev=162675&view=rev
Log:
CMake build rules for ASan/Android runtime.
Modified:
compiler-rt/trunk/CMakeLists.txt
compiler-rt/trunk/lib/asan/CMakeLists.txt
compiler-rt/trunk/lib/interception/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=162675&r1=162674&r2=162675&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Aug 27 09:28:27 2012
@@ -48,6 +48,20 @@
COMPILE_DEFINITIONS "${TARGET_I386_CFLAGS}"
CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_I386_CFLAGS}")
+if(LLVM_ANDROID_TOOLCHAIN_DIR)
+ if(EXISTS ${LLVM_ANDROID_TOOLCHAIN_DIR}/arm-linux-androideabi)
+ set(CAN_TARGET_ARM_ANDROID 1)
+ set(TARGET_ARM_ANDROID_CFLAGS
+ -target arm-linux-androideabi
+ --sysroot=${LLVM_ANDROID_TOOLCHAIN_DIR}/sysroot
+ -B${LLVM_ANDROID_TOOLCHAIN_DIR}
+ )
+ else()
+ set(CAN_TARGET_ARM_ANDROID 0)
+ endif()
+ # TODO: support i686 and MIPS Android toolchains
+endif()
+
function(filter_available_targets out_var)
set(archs)
foreach(arch ${ARGN})
Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=162675&r1=162674&r2=162675&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Mon Aug 27 09:28:27 2012
@@ -94,6 +94,17 @@
)
list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan-i386)
endif()
+ if(CAN_TARGET_ARM_ANDROID)
+ add_library(clang_rt.asan-arm-android STATIC
+ ${ASAN_SOURCES}
+ $<TARGET_OBJECTS:RTInterception.arm.android>
+ $<TARGET_OBJECTS:RTSanitizerCommon.arm.android>
+ )
+ set_target_compile_flags(clang_rt.asan-arm-android
+ ${ASAN_CFLAGS} ${TARGET_ARM_ANDROID_CFLAGS}
+ )
+ list(APPEND ASAN_RUNTIME_LIBRARIES clang_rt.asan-arm-android)
+ endif()
endif()
set_property(TARGET ${ASAN_RUNTIME_LIBRARIES} APPEND PROPERTY
Modified: compiler-rt/trunk/lib/interception/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/CMakeLists.txt?rev=162675&r1=162674&r2=162675&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/interception/CMakeLists.txt Mon Aug 27 09:28:27 2012
@@ -43,4 +43,9 @@
set_target_compile_flags(RTInterception.i386
${INTERCEPTION_CFLAGS} ${TARGET_I386_CFLAGS})
endif()
+ if(CAN_TARGET_ARM_ANDROID)
+ add_library(RTInterception.arm.android OBJECT ${INTERCEPTION_SOURCES})
+ set_target_compile_flags(RTInterception.arm.android
+ ${INTERCEPTION_CFLAGS} ${TARGET_ARM_ANDROID_CFLAGS})
+ endif()
endif()
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=162675&r1=162674&r2=162675&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Mon Aug 27 09:28:27 2012
@@ -50,6 +50,12 @@
${SANITIZER_CFLAGS} ${TARGET_I386_CFLAGS})
list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.i386)
endif()
+ if(CAN_TARGET_ARM_ANDROID)
+ add_library(RTSanitizerCommon.arm.android OBJECT ${SANITIZER_SOURCES})
+ set_target_compile_flags(RTSanitizerCommon.arm.android
+ ${SANITIZER_CFLAGS} ${TARGET_ARM_ANDROID_CFLAGS})
+ list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.arm.android)
+ endif()
endif()
set_property(TARGET ${SANITIZER_RUNTIME_LIBRARIES} APPEND PROPERTY
More information about the llvm-commits
mailing list