[Mac/GN][sanitizers] Copy the ASan runtime to the output directory.

This sets it as a data_deps so that any targets depending on the sanitizer
will also pick up the runtime file when being isolated.

Because the ASan runtime uses @loader_path this will not work for bundled
targets, only standalone executables.

BUG=597066,431177
R=aizatsky@chromium.org

Review-Url: https://codereview.chromium.org/1963253002
Cr-Original-Commit-Position: refs/heads/master@{#393335}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 45384fb36763bb34ac3a7395d2dc941754a276ae
This commit is contained in:
rsesek 2016-05-12 12:46:22 -07:00 коммит произвёл Commit bot
Родитель 39b207f5fd
Коммит 6fb8472d07
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -5,6 +5,7 @@
import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/toolchain.gni")
# Contains the dependencies needed for sanitizers to link into executables and
# shared_libraries. Unconditionally depend upon this target as it is empty if
@ -41,6 +42,22 @@ group("deps_no_options") {
if (use_custom_libcxx) {
deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ]
}
if (is_mac) {
data_deps = [
":copy_asan_runtime",
]
}
}
}
if (is_mac) {
copy("copy_asan_runtime") {
sources = [
"//third_party/llvm-build/Release+Asserts/lib/clang/$clang_version/lib/darwin/libclang_rt.asan_osx_dynamic.dylib",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}