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

Unified 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: add copy_asan_runtime 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') | build/toolchain/win/BUILD.gn » ('j') | 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 1330a1f8aa3f2d66191b8d3e638eabedfa2197a8..d6732dcf001980f42b1c86aa7d7d1862520d0080 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -66,34 +66,46 @@ group("deps_no_options") {
public_deps += [ "//buildtools/third_party/libc++:libcxx_proxy" ]
data += [ "$root_out_dir/libc++.so" ]
}
- if (is_mac) {
+
+ if (is_mac || is_win) {
data_deps = [
":copy_asan_runtime",
]
+ }
+ if (is_mac) {
public_deps += [ ":asan_runtime_bundle_data" ]
}
}
}
-if (is_mac && using_sanitizer) {
+if (using_sanitizer) {
copy("copy_asan_runtime") {
- sources = [
- "$clang_base_path/lib/clang/$clang_version/lib/darwin/libclang_rt.asan_osx_dynamic.dylib",
- ]
+ if (is_mac) {
+ sources = [
+ "$clang_base_path/lib/clang/$clang_version/lib/darwin/libclang_rt.asan_osx_dynamic.dylib",
+ ]
+ } else if (is_win) {
+ sources = [
+ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-i386.dll",
+ "$clang_base_path/lib/clang/$clang_version/lib/windows/clang_rt.asan_dynamic-x86_64.dll",
+ ]
+ }
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
- bundle_data("asan_runtime_bundle_data") {
- sources = get_target_outputs(":copy_asan_runtime")
- outputs = [
- "{{bundle_executable_dir}}/{{source_file_part}}",
- ]
- public_deps = [
- ":copy_asan_runtime",
- ]
+ if (is_mac) {
+ bundle_data("asan_runtime_bundle_data") {
+ sources = get_target_outputs(":copy_asan_runtime")
+ outputs = [
+ "{{bundle_executable_dir}}/{{source_file_part}}",
+ ]
+ public_deps = [
+ ":copy_asan_runtime",
+ ]
+ }
}
}
@@ -134,6 +146,16 @@ static_library("options_sources") {
}
}
+config("executable_config") {
+ if (is_win && is_asan) {
+ if (current_cpu == "x64") {
+ libs = [ "clang_rt.asan_dynamic-x86_64.lib" ]
+ } else {
+ libs = [ "clang_rt.asan_dynamic-i386.lib" ]
+ }
+ }
+}
+
# Applies linker flags necessary when either :deps or :default_sanitizer_flags
# are used.
config("default_sanitizer_ldflags") {
@@ -238,7 +260,7 @@ config("asan_flags") {
}
if (is_win) {
- if (target_cpu == "x64") {
+ if (current_cpu == "x64") {
# Windows 64-bit.
if (is_component_build) {
libs = [
@@ -246,21 +268,17 @@ config("asan_flags") {
"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" ]
+ libs = [ "clang_rt.asan_dynamic_runtime_thunk-x86_64.lib" ]
}
} else {
- assert(target_cpu == "x86", "WinASan unsupported architecture")
+ assert(current_cpu == "x86", "WinASan unsupported architecture")
if (is_component_build) {
libs = [
"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" ]
+ libs = [ "clang_rt.asan_dynamic_runtime_thunk-i386.lib" ]
}
}
}
« no previous file with comments | « 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