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

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

Issue 2570153002: Fix missing CRT libraries with ASAN unittests (Closed)
Patch Set: remove debug code Created 4 years 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_overrides/build.gni") 5 import("//build_overrides/build.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/chromecast_build.gni") 7 import("//build/config/chromecast_build.gni")
8 import("//build/config/clang/clang.gni") 8 import("//build/config/clang/clang.gni")
9 import("//build/config/sanitizers/sanitizers.gni") 9 import("//build/config/sanitizers/sanitizers.gni")
10 import("//build/toolchain/toolchain.gni") 10 import("//build/toolchain/toolchain.gni")
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 prefix = "//buildtools/third_party" 289 prefix = "//buildtools/third_party"
290 include = "trunk/include" 290 include = "trunk/include"
291 cflags_cc += [ 291 cflags_cc += [
292 "-nostdinc++", 292 "-nostdinc++",
293 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), 293 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir),
294 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), 294 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir),
295 ] 295 ]
296 } 296 }
297 } 297 }
298 298
299 config("sanitizer_default_libs") {
300 # The clang sanitizers (compiler-rt/ASAN) runtime requires functions from the
301 # CRT. This config must be added to targets that are removing the default
302 # librairies using the linker options "/NOENTRY", "/ENTRY" or "/NODEFAULTLIB".
Dirk Pranke 2016/12/18 04:20:49 s/librairies/libraries/
etienneb 2017/01/11 16:05:32 Done.
303
304 if (is_asan && is_win) {
305 assert(!is_debug, "win/asan does not support linking with debug CRT")
306
307 if (is_component_build) {
308 libs = [
309 "msvcrt.lib",
310 "ucrt.lib",
311 "vcruntime.lib",
312 ]
313 } else {
314 libs = [
315 "libcmt.lib",
316 "libucrt.lib",
317 "libvcruntime.lib",
318 ]
319 }
320 }
321 }
322
299 config("asan_flags") { 323 config("asan_flags") {
300 cflags = [] 324 cflags = []
301 if (is_asan) { 325 if (is_asan) {
302 cflags += [ "-fsanitize=address" ] 326 cflags += [ "-fsanitize=address" ]
303 if (!asan_globals) { 327 if (!asan_globals) {
304 cflags += [ 328 cflags += [
305 "-mllvm", 329 "-mllvm",
306 "-asan-globals=0", 330 "-asan-globals=0",
307 ] 331 ]
308 } 332 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 # This allows to selectively disable ubsan_vptr, when needed. In particular, 563 # This allows to selectively disable ubsan_vptr, when needed. In particular,
540 # if some third_party code is required to be compiled without rtti, which 564 # if some third_party code is required to be compiled without rtti, which
541 # is a requirement for ubsan_vptr. 565 # is a requirement for ubsan_vptr.
542 config("default_sanitizer_flags_but_ubsan_vptr") { 566 config("default_sanitizer_flags_but_ubsan_vptr") {
543 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] 567 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ]
544 } 568 }
545 569
546 config("default_sanitizer_flags_but_coverage") { 570 config("default_sanitizer_flags_but_coverage") {
547 configs = all_sanitizer_configs - [ ":coverage_flags" ] 571 configs = all_sanitizer_configs - [ ":coverage_flags" ]
548 } 572 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698