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

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

Issue 2208093003: Make base_unittests pass in gn/win/asan builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dpranke nit Created 4 years, 4 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
« no previous file with comments | « build/config/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 rebase_path("//tools/memory/asan/blacklist_win.txt", 241 rebase_path("//tools/memory/asan/blacklist_win.txt",
242 root_build_dir) ] 242 root_build_dir) ]
243 } else { 243 } else {
244 # TODO(rnk): Remove this as discussed in http://crbug.com/427202. 244 # TODO(rnk): Remove this as discussed in http://crbug.com/427202.
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
252 # and dlls, see link_executable and link_shared_library below.
253 # This here handles only the component build.
251 if (target_cpu == "x64") { 254 if (target_cpu == "x64") {
252 # Windows 64-bit. 255 # Windows 64-bit.
253 if (is_component_build) { 256 if (is_component_build) {
254 libs = [ 257 libs = [
255 "clang_rt.asan_dynamic-x86_64.lib", 258 "clang_rt.asan_dynamic-x86_64.lib",
256 "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib", 259 "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
257 ] 260 ]
258 } else {
259 # TODO(etienneb): DLLs in the non-component build should link against
260 # clang_rt.asan_dll_thunk-x86_64.lib instead.
261 libs = [ "clang_rt.asan-x86_64.lib" ]
262 } 261 }
263 } else { 262 } else {
264 assert(target_cpu == "x86", "WinASan unsupported architecture") 263 assert(target_cpu == "x86", "WinASan unsupported architecture")
265 if (is_component_build) { 264 if (is_component_build) {
266 libs = [ 265 libs = [
267 "clang_rt.asan_dynamic-i386.lib", 266 "clang_rt.asan_dynamic-i386.lib",
268 "clang_rt.asan_dynamic_runtime_thunk-i386.lib", 267 "clang_rt.asan_dynamic_runtime_thunk-i386.lib",
269 ] 268 ]
270 } else {
271 # TODO(etienneb): DLLs in the non-component build should link against
272 # clang_rt.asan_dll_thunk-i386.lib instead.
273 libs = [ "clang_rt.asan-i386.lib" ]
274 } 269 }
275 } 270 }
276 } 271 }
277 } 272 }
278 } 273 }
279 274
275 config("link_executable") {
276 if (is_asan && is_win && !is_component_build) {
277 if (target_cpu == "x64") {
278 # Windows 64-bit.
279 libs = [ "clang_rt.asan-x86_64.lib" ]
280 } else {
281 assert(target_cpu == "x86", "WinASan unsupported architecture")
282 libs = [ "clang_rt.asan-i386.lib" ]
283 }
284 }
285 }
286
287 config("link_shared_library") {
288 if (is_asan && is_win && !is_component_build) {
289 if (target_cpu == "x64") {
290 # Windows 64-bit.
291 libs = [ "clang_rt.asan_dll_thunk-x86_64.lib" ]
292 } else {
293 assert(target_cpu == "x86", "WinASan unsupported architecture")
294 libs = [ "clang_rt.asan_dll_thunk-i386.lib" ]
295 }
296 }
297 }
298
280 config("cfi_flags") { 299 config("cfi_flags") {
281 cflags = [] 300 cflags = []
282 if (is_cfi && !is_nacl) { 301 if (is_cfi && !is_nacl) {
283 cfi_blacklist_path = 302 cfi_blacklist_path =
284 rebase_path("//tools/cfi/blacklist.txt", root_build_dir) 303 rebase_path("//tools/cfi/blacklist.txt", root_build_dir)
285 cflags += [ 304 cflags += [
286 "-fsanitize=cfi-vcall", 305 "-fsanitize=cfi-vcall",
287 "-fsanitize-blacklist=$cfi_blacklist_path", 306 "-fsanitize-blacklist=$cfi_blacklist_path",
288 ] 307 ]
289 308
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 # This allows to selectively disable ubsan_vptr, when needed. In particular, 486 # This allows to selectively disable ubsan_vptr, when needed. In particular,
468 # if some third_party code is required to be compiled without rtti, which 487 # if some third_party code is required to be compiled without rtti, which
469 # is a requirement for ubsan_vptr. 488 # is a requirement for ubsan_vptr.
470 config("default_sanitizer_flags_but_ubsan_vptr") { 489 config("default_sanitizer_flags_but_ubsan_vptr") {
471 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] 490 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ]
472 } 491 }
473 492
474 config("default_sanitizer_flags_but_coverage") { 493 config("default_sanitizer_flags_but_coverage") {
475 configs = all_sanitizer_configs - [ ":coverage_flags" ] 494 configs = all_sanitizer_configs - [ ":coverage_flags" ]
476 } 495 }
OLDNEW
« no previous file with comments | « build/config/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698