[compiler-rt] r202362 - [asan] Install asan_device_setup to bin/ when targetting Android.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Thu Feb 27 00:41:40 PST 2014
Author: eugenis
Date: Thu Feb 27 02:41:40 2014
New Revision: 202362
URL: http://llvm.org/viewvc/llvm-project?rev=202362&view=rev
Log:
[asan] Install asan_device_setup to bin/ when targetting Android.
asan_device_setup is a utility that prepares a device to run code built with
ASan. Essentially, it installs ASan runtime library into the system. For this
reason, it has to be at a predictable relative path from the runtime library
itself. We also plan to distribute this utility, packaged with runtime library
and maybe llvm-symbolizer, to the users.
Added:
compiler-rt/trunk/lib/asan/scripts/CMakeLists.txt (with props)
Modified:
compiler-rt/trunk/CMakeLists.txt
compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
compiler-rt/trunk/lib/asan/CMakeLists.txt
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=202362&r1=202361&r2=202362&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Feb 27 02:41:40 2014
@@ -51,6 +51,7 @@ if (NOT COMPILER_RT_STANDALONE_BUILD)
${PACKAGE_VERSION})
# Setup the paths where compiler-rt runtimes and headers should be stored.
set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
+ set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests."
${LLVM_INCLUDE_TESTS})
@@ -63,6 +64,8 @@ else()
# Take output dir and install path from the user.
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
"Path where built compiler-rt libraries should be stored.")
+ set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH
+ "Path where built compiler-rt executables should be stored.")
set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH
"Path where built compiler-rt libraries should be installed.")
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=202362&r1=202361&r2=202362&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Thu Feb 27 02:41:40 2014
@@ -146,3 +146,16 @@ macro(add_compiler_rt_resource_file targ
# Install in Clang resource directory.
install(FILES ${file_name} DESTINATION ${COMPILER_RT_INSTALL_PATH})
endmacro()
+
+macro(add_compiler_rt_script name)
+ set(dst ${COMPILER_RT_EXEC_OUTPUT_DIR}/${name})
+ set(src ${CMAKE_CURRENT_SOURCE_DIR}/${name})
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying ${name}...")
+ add_custom_target(${name} DEPENDS ${dst})
+ install(FILES ${dst}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin)
+endmacro(add_compiler_rt_script src name)
Modified: compiler-rt/trunk/lib/asan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/CMakeLists.txt?rev=202362&r1=202361&r2=202362&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/asan/CMakeLists.txt Thu Feb 27 02:41:40 2014
@@ -142,6 +142,8 @@ add_compiler_rt_resource_file(asan_black
add_dependencies(asan asan_blacklist)
add_dependencies(compiler-rt asan)
+add_subdirectory(scripts)
+
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
endif()
Added: compiler-rt/trunk/lib/asan/scripts/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/scripts/CMakeLists.txt?rev=202362&view=auto
==============================================================================
--- compiler-rt/trunk/lib/asan/scripts/CMakeLists.txt (added)
+++ compiler-rt/trunk/lib/asan/scripts/CMakeLists.txt Thu Feb 27 02:41:40 2014
@@ -0,0 +1,4 @@
+if(ANDROID)
+ add_compiler_rt_script(asan_device_setup)
+ add_dependencies(asan asan_device_setup)
+endif()
Propchange: compiler-rt/trunk/lib/asan/scripts/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = LF
More information about the llvm-commits
mailing list