[PATCH] [asan] Install asan_device_setup to bin/ when targetting Android
Evgeniy Stepanov
eugenis at google.com
Wed Feb 26 07:16:37 PST 2014
eugenis added you to the CC list for the revision "[asan] Install asan_device_setup to bin/ when targetting Android".
Hi samsonov,
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.
http://llvm-reviews.chandlerc.com/D2887
Files:
lib/asan/scripts/CMakeLists.txt
lib/asan/CMakeLists.txt
CMakeLists.txt
Index: lib/asan/scripts/CMakeLists.txt
===================================================================
--- lib/asan/scripts/CMakeLists.txt
+++ lib/asan/scripts/CMakeLists.txt
@@ -0,0 +1,14 @@
+macro(add_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} ALL DEPENDS ${dst})
+endmacro(add_script src name)
+
+if(ANDROID)
+ add_script(asan_device_setup)
+ add_dependencies(asan_device_setup asan)
+endif()
Index: lib/asan/CMakeLists.txt
===================================================================
--- lib/asan/CMakeLists.txt
+++ lib/asan/CMakeLists.txt
@@ -138,3 +138,5 @@
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
endif()
+
+add_subdirectory(scripts)
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -37,6 +37,7 @@
${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})
@@ -49,6 +50,8 @@
# 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} 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2887.1.patch
Type: text/x-patch
Size: 2093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140226/f4ab2cec/attachment.bin>
More information about the llvm-commits
mailing list