Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: build/config/sanitizers/BUILD.gn

Issue 1818273002: [libfuzzer] supporting libfuzzer on mac with asan (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved dynamic library copy Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
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
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) {
Alexander Potapenko 2016/03/24 21:58:43 Does is_mac mean only OSX, or both OSX and iOS/ios
aizatsky 2016/03/24 22:31:33 Ios is is_ios. No I don't want to support any of t
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 # Needed on 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",
312 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_rt .tsan_osx_dynamic.dylib",
Alexander Potapenko 2016/03/24 21:58:43 You don't seem to need TSan/UBSan runtimes for ASa
aizatsky 2016/03/24 22:31:33 I do not at this time. But other sanitizers might.
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 }
OLDNEW
« BUILD.gn ('K') | « BUILD.gn ('k') | build/config/sanitizers/sanitizers.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698