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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/BUILD.gn
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index f3c02b037d402c1a61ecbc6561f973749d9c5ba5..08ecb8d337a535288a04d46a0e04e93784d91dd4 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -248,6 +248,9 @@ config("asan_flags") {
}
if (is_win) {
+ # In the static-library build, libraries are different for executables
+ # and dlls, see link_executable and link_shared_library below.
+ # This here handles only the component build.
if (target_cpu == "x64") {
# Windows 64-bit.
if (is_component_build) {
@@ -255,10 +258,6 @@ config("asan_flags") {
"clang_rt.asan_dynamic-x86_64.lib",
"clang_rt.asan_dynamic_runtime_thunk-x86_64.lib",
]
- } else {
- # TODO(etienneb): DLLs in the non-component build should link against
- # clang_rt.asan_dll_thunk-x86_64.lib instead.
- libs = [ "clang_rt.asan-x86_64.lib" ]
}
} else {
assert(target_cpu == "x86", "WinASan unsupported architecture")
@@ -267,16 +266,36 @@ config("asan_flags") {
"clang_rt.asan_dynamic-i386.lib",
"clang_rt.asan_dynamic_runtime_thunk-i386.lib",
]
- } else {
- # TODO(etienneb): DLLs in the non-component build should link against
- # clang_rt.asan_dll_thunk-i386.lib instead.
- libs = [ "clang_rt.asan-i386.lib" ]
}
}
}
}
}
+config("link_executable") {
+ if (is_asan && is_win && !is_component_build) {
+ if (target_cpu == "x64") {
+ # Windows 64-bit.
+ libs = [ "clang_rt.asan-x86_64.lib" ]
+ } else {
+ assert(target_cpu == "x86", "WinASan unsupported architecture")
+ libs = [ "clang_rt.asan-i386.lib" ]
+ }
+ }
+}
+
+config("link_shared_library") {
+ if (is_asan && is_win && !is_component_build) {
+ if (target_cpu == "x64") {
+ # Windows 64-bit.
+ libs = [ "clang_rt.asan_dll_thunk-x86_64.lib" ]
+ } else {
+ assert(target_cpu == "x86", "WinASan unsupported architecture")
+ libs = [ "clang_rt.asan_dll_thunk-i386.lib" ]
+ }
+ }
+}
+
config("cfi_flags") {
cflags = []
if (is_cfi && !is_nacl) {
« 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