| 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/clang/clang.gni") | 7 import("//build/config/clang/clang.gni") |
| 8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 cflags += | 245 cflags += |
| 246 [ "-fsanitize-blacklist=" + | 246 [ "-fsanitize-blacklist=" + |
| 247 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) ] | 247 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) ] |
| 248 } | 248 } |
| 249 | 249 |
| 250 if (is_win) { | 250 if (is_win) { |
| 251 # In the static-library build, libraries are different for executables | 251 # In the static-library build, libraries are different for executables |
| 252 # and dlls, see link_executable and link_shared_library below. | 252 # and dlls, see link_executable and link_shared_library below. |
| 253 # This here handles only the component build. | 253 # This here handles only the component build. |
| 254 if (target_cpu == "x64") { | 254 if (target_cpu == "x64") { |
| 255 # Windows 64-bit. | 255 # Windows 64-bit. TODO(etienneb): Remove the assert when this is ready. |
| 256 if (is_component_build) { | 256 if (is_component_build) { |
| 257 assert(false, "win/asan does not work in 64-bit yet") |
| 257 libs = [ | 258 libs = [ |
| 258 "clang_rt.asan_dynamic-x86_64.lib", | 259 "clang_rt.asan_dynamic-x86_64.lib", |
| 259 "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib", | 260 "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib", |
| 260 ] | 261 ] |
| 261 } | 262 } |
| 262 } else { | 263 } else { |
| 263 assert(target_cpu == "x86", "WinASan unsupported architecture") | 264 assert(target_cpu == "x86", "WinASan unsupported architecture") |
| 264 if (is_component_build) { | 265 if (is_component_build) { |
| 265 libs = [ | 266 libs = [ |
| 266 "clang_rt.asan_dynamic-i386.lib", | 267 "clang_rt.asan_dynamic-i386.lib", |
| 267 "clang_rt.asan_dynamic_runtime_thunk-i386.lib", | 268 "clang_rt.asan_dynamic_runtime_thunk-i386.lib", |
| 268 ] | 269 ] |
| 269 } | 270 } |
| 270 } | 271 } |
| 271 } | 272 } |
| 272 } | 273 } |
| 273 } | 274 } |
| 274 | 275 |
| 275 config("link_executable") { | 276 config("link_executable") { |
| 276 if (is_asan && is_win && !is_component_build) { | 277 if (is_asan && is_win && !is_component_build) { |
| 277 if (target_cpu == "x64") { | 278 if (target_cpu == "x64") { |
| 278 # Windows 64-bit. | 279 # Windows 64-bit. TODO(etienneb): Remove the assert when this is ready. |
| 280 assert(false, "win/asan does not work in 64-bit yet") |
| 279 libs = [ "clang_rt.asan-x86_64.lib" ] | 281 libs = [ "clang_rt.asan-x86_64.lib" ] |
| 280 } else { | 282 } else { |
| 281 assert(target_cpu == "x86", "WinASan unsupported architecture") | 283 assert(target_cpu == "x86", "WinASan unsupported architecture") |
| 282 libs = [ "clang_rt.asan-i386.lib" ] | 284 libs = [ "clang_rt.asan-i386.lib" ] |
| 283 } | 285 } |
| 284 } | 286 } |
| 285 } | 287 } |
| 286 | 288 |
| 287 config("link_shared_library") { | 289 config("link_shared_library") { |
| 288 if (is_asan && is_win && !is_component_build) { | 290 if (is_asan && is_win && !is_component_build) { |
| 289 if (target_cpu == "x64") { | 291 if (target_cpu == "x64") { |
| 290 # Windows 64-bit. | 292 # Windows 64-bit. TODO(etienneb): Remove the assert when this is ready. |
| 293 assert(false, "win/asan does not work in 64-bit yet") |
| 291 libs = [ "clang_rt.asan_dll_thunk-x86_64.lib" ] | 294 libs = [ "clang_rt.asan_dll_thunk-x86_64.lib" ] |
| 292 } else { | 295 } else { |
| 293 assert(target_cpu == "x86", "WinASan unsupported architecture") | 296 assert(target_cpu == "x86", "WinASan unsupported architecture") |
| 294 libs = [ "clang_rt.asan_dll_thunk-i386.lib" ] | 297 libs = [ "clang_rt.asan_dll_thunk-i386.lib" ] |
| 295 } | 298 } |
| 296 } | 299 } |
| 297 } | 300 } |
| 298 | 301 |
| 299 config("cfi_flags") { | 302 config("cfi_flags") { |
| 300 cflags = [] | 303 cflags = [] |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 489 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
| 487 # if some third_party code is required to be compiled without rtti, which | 490 # if some third_party code is required to be compiled without rtti, which |
| 488 # is a requirement for ubsan_vptr. | 491 # is a requirement for ubsan_vptr. |
| 489 config("default_sanitizer_flags_but_ubsan_vptr") { | 492 config("default_sanitizer_flags_but_ubsan_vptr") { |
| 490 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 493 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
| 491 } | 494 } |
| 492 | 495 |
| 493 config("default_sanitizer_flags_but_coverage") { | 496 config("default_sanitizer_flags_but_coverage") { |
| 494 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 497 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
| 495 } | 498 } |
| OLD | NEW |