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

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

Issue 2570153002: Fix missing CRT libraries with ASAN unittests (Closed)
Patch Set: remove debug code Created 4 years 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
Index: build/config/sanitizers/BUILD.gn
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index 36d45c1d1b6f1edf77020d965aec0f298c3fa702..ef644f64596414ea349332c84fa0ee0aa6270927 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -296,6 +296,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
+ # librairies using the linker options "/NOENTRY", "/ENTRY" or "/NODEFAULTLIB".
Dirk Pranke 2016/12/18 04:20:49 s/librairies/libraries/
etienneb 2017/01/11 16:05:32 Done.
+
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698