Commit 85f2f960 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Turn off CFG when not needed

Control Flow Guard is a security feature that can help stop exploits. It
is primarily need on our official builds. On the debug and component
builds where Chromium is primarily developed it just adds a bit of
extra size to the object files.

This was fine until it triggered a spurious link error in component
builds when symbol_level=2 was selected. This wasn't caught by the bots
because most (all?) of them build with symbol_level=1, or non-component.

This turns off CFG for debug and component builds, thus getting those
builds working again for developers.

Bug: 1019970
Change-Id: I7a56af177452e62a5f3ad1daa608970cb9518d4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1891991Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711083}
parent b20d95af
...@@ -89,7 +89,11 @@ config("compiler") { ...@@ -89,7 +89,11 @@ config("compiler") {
# don't emit the CFG checks themselves, but this enables the functions to # don't emit the CFG checks themselves, but this enables the functions to
# be called by code that is built with those checks enabled, such as system # be called by code that is built with those checks enabled, such as system
# libraries. # libraries.
cflags += [ "/guard:cf,nochecks" ] if (!is_debug && !is_component_build) {
# CFG isn't needed on debug or component builds, adds a bit of bloat to
# .obj files, and caused link errors once - https://crbug.com/1019970
cflags += [ "/guard:cf,nochecks" ]
}
if (is_component_build) { if (is_component_build) {
cflags += [ cflags += [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment