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

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

Issue 2198333002: Make Win Clang ASan builds work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify win toolchain change a bit 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
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 if (is_lsan) { 128 if (is_lsan) {
129 sources += [ "//build/sanitizers/lsan_suppressions.cc" ] 129 sources += [ "//build/sanitizers/lsan_suppressions.cc" ]
130 } 130 }
131 131
132 if (is_tsan) { 132 if (is_tsan) {
133 sources += [ "//build/sanitizers/tsan_suppressions.cc" ] 133 sources += [ "//build/sanitizers/tsan_suppressions.cc" ]
134 } 134 }
135 } 135 }
136 136
137 config("executable_config") {
138 if (is_win && is_asan) {
139 if (current_cpu == "x64") {
140 libs = [ "clang_rt.asan_dynamic-x86_64.lib" ]
141 } else {
142 libs = [ "clang_rt.asan_dynamic-i386.lib" ]
143 }
144 }
145 }
146
137 # Applies linker flags necessary when either :deps or :default_sanitizer_flags 147 # Applies linker flags necessary when either :deps or :default_sanitizer_flags
138 # are used. 148 # are used.
139 config("default_sanitizer_ldflags") { 149 config("default_sanitizer_ldflags") {
140 visibility = [ 150 visibility = [
141 ":default_sanitizer_flags", 151 ":default_sanitizer_flags",
142 ":deps", 152 ":deps",
143 ] 153 ]
144 154
145 if (is_posix) { 155 if (is_posix) {
146 ldflags = [] 156 ldflags = []
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 rebase_path("//tools/memory/asan/blacklist_win.txt", 241 rebase_path("//tools/memory/asan/blacklist_win.txt",
232 root_build_dir) ] 242 root_build_dir) ]
233 } else { 243 } else {
234 # TODO(rnk): Remove this as discussed in http://crbug.com/427202. 244 # TODO(rnk): Remove this as discussed in http://crbug.com/427202.
235 cflags += 245 cflags +=
236 [ "-fsanitize-blacklist=" + 246 [ "-fsanitize-blacklist=" +
237 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) ] 247 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) ]
238 } 248 }
239 249
240 if (is_win) { 250 if (is_win) {
241 if (target_cpu == "x64") { 251 if (current_cpu == "x64") {
242 # Windows 64-bit. 252 # Windows 64-bit.
243 if (is_component_build) { 253 if (is_component_build) {
244 libs = [ 254 libs = [
245 "clang_rt.asan_dynamic-x86_64.lib", 255 "clang_rt.asan_dynamic-x86_64.lib",
246 "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib", 256 "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
247 ] 257 ]
248 } else { 258 } else {
249 # TODO(etienneb): DLLs in the non-component build should link against 259 libs = [ "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ]
Nico 2016/08/02 14:20:51 Why is this needed here at all now that the other
Dirk Pranke 2016/08/02 17:19:03 Yes, I think you're right.
250 # clang_rt.asan_dll_thunk-x86_64.lib instead.
251 libs = [ "clang_rt.asan-x86_64.lib" ]
252 } 260 }
253 } else { 261 } else {
254 assert(target_cpu == "x86", "WinASan unsupported architecture") 262 assert(current_cpu == "x86", "WinASan unsupported architecture")
255 if (is_component_build) { 263 if (is_component_build) {
256 libs = [ 264 libs = [
257 "clang_rt.asan_dynamic-i386.lib", 265 "clang_rt.asan_dynamic-i386.lib",
258 "clang_rt.asan_dynamic_runtime_thunk-i386.lib", 266 "clang_rt.asan_dynamic_runtime_thunk-i386.lib",
259 ] 267 ]
260 } else { 268 } else {
261 # TODO(etienneb): DLLs in the non-component build should link against 269 libs = [ "clang_rt.asan_dynamic_runtime_thunk-i386.lib" ]
262 # clang_rt.asan_dll_thunk-i386.lib instead.
263 libs = [ "clang_rt.asan-i386.lib" ]
264 } 270 }
265 } 271 }
266 } 272 }
267 } 273 }
268 } 274 }
269 275
270 config("cfi_flags") { 276 config("cfi_flags") {
271 cflags = [] 277 cflags = []
272 if (is_cfi && !is_nacl) { 278 if (is_cfi && !is_nacl) {
273 cfi_blacklist_path = 279 cfi_blacklist_path =
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 # This allows to selectively disable ubsan_vptr, when needed. In particular, 463 # This allows to selectively disable ubsan_vptr, when needed. In particular,
458 # if some third_party code is required to be compiled without rtti, which 464 # if some third_party code is required to be compiled without rtti, which
459 # is a requirement for ubsan_vptr. 465 # is a requirement for ubsan_vptr.
460 config("default_sanitizer_flags_but_ubsan_vptr") { 466 config("default_sanitizer_flags_but_ubsan_vptr") {
461 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] 467 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ]
462 } 468 }
463 469
464 config("default_sanitizer_flags_but_coverage") { 470 config("default_sanitizer_flags_but_coverage") {
465 configs = all_sanitizer_configs - [ ":coverage_flags" ] 471 configs = all_sanitizer_configs - [ ":coverage_flags" ]
466 } 472 }
OLDNEW
« build/config/BUILD.gn ('K') | « build/config/BUILD.gn ('k') | build/toolchain/win/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698