OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
6 import("//build/config/chromecast_build.gni") | 6 import("//build/config/chromecast_build.gni") |
7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
8 | 8 |
9 # Contains the dependencies needed for sanitizers to link into executables and | 9 # Contains the dependencies needed for sanitizers to link into executables and |
10 # shared_libraries. Unconditionally depend upon this target as it is empty if | 10 # shared_libraries. Unconditionally depend upon this target as it is empty if |
(...skipping 10 matching lines...) Expand all Loading... | |
21 ] | 21 ] |
22 deps = [ | 22 deps = [ |
23 ":options_sources", | 23 ":options_sources", |
24 ] | 24 ] |
25 | 25 |
26 if (use_prebuilt_instrumented_libraries) { | 26 if (use_prebuilt_instrumented_libraries) { |
27 deps += [ "//third_party/instrumented_libraries:deps" ] | 27 deps += [ "//third_party/instrumented_libraries:deps" ] |
28 } | 28 } |
29 if (use_custom_libcxx) { | 29 if (use_custom_libcxx) { |
30 deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ] | 30 deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ] |
31 if (is_mac) { | |
Alexander Potapenko
2016/03/30 11:05:00
Why is this flag checked only under use_custom_lib
| |
32 deps += [ ":copy_libclang_rt_dyn" ] | |
33 } | |
31 } | 34 } |
32 } | 35 } |
33 } | 36 } |
34 | 37 |
35 config("sanitizer_options_link_helper") { | 38 config("sanitizer_options_link_helper") { |
36 ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ] | 39 if (!is_mac) { |
40 ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ] | |
41 } | |
37 } | 42 } |
38 | 43 |
39 source_set("options_sources") { | 44 source_set("options_sources") { |
40 visibility = [ | 45 visibility = [ |
41 ":deps", | 46 ":deps", |
42 "//:gn_visibility", | 47 "//:gn_visibility", |
43 ] | 48 ] |
44 sources = [ | 49 sources = [ |
45 "//build/sanitizers/sanitizer_options.cc", | 50 "//build/sanitizers/sanitizer_options.cc", |
46 ] | 51 ] |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 if (use_custom_libcxx) { | 282 if (use_custom_libcxx) { |
278 prefix = "//buildtools/third_party" | 283 prefix = "//buildtools/third_party" |
279 include = "trunk/include" | 284 include = "trunk/include" |
280 cflags_cc += [ | 285 cflags_cc += [ |
281 "-nostdinc++", | 286 "-nostdinc++", |
282 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), | 287 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), |
283 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), | 288 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), |
284 ] | 289 ] |
285 } | 290 } |
286 } | 291 } |
292 | |
293 if (is_mac && is_asan) { | |
294 libs = [ "clang_rt.asan_osx_dynamic" ] | |
295 } | |
287 } | 296 } |
288 | 297 |
289 config("default_sanitizer_coverage_flags") { | 298 config("default_sanitizer_coverage_flags") { |
290 cflags = [] | 299 cflags = [] |
291 | 300 |
292 if (use_sanitizer_coverage) { | 301 if (use_sanitizer_coverage) { |
293 # FIXME: make this configurable. | 302 # FIXME: make this configurable. |
294 cflags += [ "-fsanitize-coverage=edge,indirect-calls,8bit-counters" ] | 303 cflags += [ "-fsanitize-coverage=edge,indirect-calls,8bit-counters" ] |
295 } | 304 } |
296 } | 305 } |
306 | |
307 # Copy dynamic clang_rt sanitizer libraries to output directory. | |
308 if (is_mac) { | |
309 copy("copy_libclang_rt_dyn") { | |
310 sources = [ | |
311 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_ rt.asan_osx_dynamic.dylib", | |
Alexander Potapenko
2016/03/30 11:05:00
This path is incorrect.
kjellander_chromium
2016/03/30 14:25:08
Right, on my Mac the path is:
third_party/llvm-bui
| |
312 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_ rt.tsan_osx_dynamic.dylib", | |
313 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_ rt.ubsan_osx_dynamic.dylib", | |
314 ] | |
315 outputs = [ | |
316 "$root_build_dir/{{source_file_part}}", | |
317 ] | |
318 } | |
319 } | |
OLD | NEW |