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

Unified Diff: build/config/sanitizers/BUILD.gn

Issue 2570153002: Fix missing CRT libraries with ASAN unittests (Closed)
Patch Set: nits Created 3 years, 11 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 | « base/win/BUILD.gn ('k') | chrome/installer/mini_installer/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 e7425461d40b6cdf5aab428f0adf66ba934dde13..2e9faf960c969f77cd15818915dbe38040d3e32c 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -305,6 +305,30 @@ config("common_sanitizer_flags") {
}
}
+config("sanitizer_default_libs") {
+ # The clang sanitizers (compiler-rt/ASAN) runtime requires functions from the
+ # CRT. This config must be added to targets that are removing the default
+ # libraries using the linker options "/NOENTRY", "/ENTRY" or "/NODEFAULTLIB".
+
+ if (is_asan && is_win) {
+ assert(!is_debug, "win/asan does not support linking with debug CRT")
+
+ if (is_component_build) {
+ libs = [
+ "msvcrt.lib",
+ "ucrt.lib",
+ "vcruntime.lib",
+ ]
+ } else {
+ libs = [
+ "libcmt.lib",
+ "libucrt.lib",
+ "libvcruntime.lib",
+ ]
+ }
+ }
+}
+
config("asan_flags") {
cflags = []
if (is_asan) {
« no previous file with comments | « base/win/BUILD.gn ('k') | chrome/installer/mini_installer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698