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) { | |
32 deps += [ ":copy_libclang_rt_dyn" ] | |
33 } | |
34 } | 31 } |
35 } | 32 } |
36 } | 33 } |
37 | 34 |
38 config("sanitizer_options_link_helper") { | 35 config("sanitizer_options_link_helper") { |
39 if (!is_mac) { | 36 ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ] |
40 ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ] | |
41 } | |
42 } | 37 } |
43 | 38 |
44 source_set("options_sources") { | 39 source_set("options_sources") { |
45 visibility = [ | 40 visibility = [ |
46 ":deps", | 41 ":deps", |
47 "//:gn_visibility", | 42 "//:gn_visibility", |
48 ] | 43 ] |
49 sources = [ | 44 sources = [ |
50 "//build/sanitizers/sanitizer_options.cc", | 45 "//build/sanitizers/sanitizer_options.cc", |
51 ] | 46 ] |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 if (use_custom_libcxx) { | 288 if (use_custom_libcxx) { |
294 prefix = "//buildtools/third_party" | 289 prefix = "//buildtools/third_party" |
295 include = "trunk/include" | 290 include = "trunk/include" |
296 cflags_cc += [ | 291 cflags_cc += [ |
297 "-nostdinc++", | 292 "-nostdinc++", |
298 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), | 293 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), |
299 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), | 294 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), |
300 ] | 295 ] |
301 } | 296 } |
302 } | 297 } |
303 | |
304 if (is_mac && is_asan) { | |
305 libs = [ "clang_rt.asan_osx_dynamic" ] | |
306 } | |
307 } | 298 } |
308 | 299 |
309 config("default_sanitizer_coverage_flags") { | 300 config("default_sanitizer_coverage_flags") { |
310 cflags = [] | 301 cflags = [] |
311 | 302 |
312 if (use_sanitizer_coverage) { | 303 if (use_sanitizer_coverage) { |
313 # FIXME: make this configurable. | 304 # FIXME: make this configurable. |
314 cflags += [ | 305 cflags += [ |
315 "-fsanitize-coverage=edge,indirect-calls,8bit-counters", | 306 "-fsanitize-coverage=edge,indirect-calls,8bit-counters", |
316 "-mllvm", | 307 "-mllvm", |
317 "-sanitizer-coverage-prune-blocks=1", | 308 "-sanitizer-coverage-prune-blocks=1", |
318 ] | 309 ] |
319 } | 310 } |
320 } | 311 } |
321 | |
322 # Copy dynamic clang_rt sanitizer libraries to output directory. | |
323 if (is_mac) { | |
324 copy("copy_libclang_rt_dyn") { | |
325 sources = [ | |
326 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.asan_osx_dynamic.dylib", | |
327 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.tsan_osx_dynamic.dylib", | |
328 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.ubsan_osx_dynamic.dylib", | |
329 ] | |
330 outputs = [ | |
331 "$root_build_dir/{{source_file_part}}", | |
332 ] | |
333 } | |
334 } | |
OLD | NEW |