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

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

Issue 2693193005: [Windows MSVC CFG] Turning on linker CFG for all. Removing CFG compile. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | chrome/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/win/BUILD.gn
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index e00bfcb8e0754da5273b568b72f009f4088fd7eb..a7db829cd6b1bc33b5f81917f905f40927067b5c 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -252,6 +252,15 @@ config("common_linker_setup") {
ldflags += [ "/DYNAMICBASE" ]
}
+ # Control Flow Guard (CFG)
+ # https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065.aspx
+ # /DYNAMICBASE (ASLR) is turned off in debug builds, therefore CFG can’t be
+ # turned on either.
+ if (!is_debug) {
+ # Turn on CFG in msvc linker, regardless of compiler used.
+ ldflags += [ "/guard:cf" ]
+ }
+
if (win_linker_timing) {
ldflags += [
"/time",
@@ -260,17 +269,6 @@ config("common_linker_setup") {
}
}
-# Control Flow Guard (CFG)
-# https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065.aspx
-config("win_msvc_cfg") {
- # /DYNAMICBASE (ASLR) is turned off in debug builds, therefore CFG can’t be
- # turned on either.
- if (!is_clang && !is_debug) {
- cflags = [ "/guard:cf" ]
- ldflags = [ "/guard:cf" ]
- }
-}
-
# CRT --------------------------------------------------------------------------
# Configures how the runtime library (CRT) is going to be used.
« no previous file with comments | « no previous file | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698