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

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

Issue 2495643002: Make /fastlink builds as optimized as non-/fastlink builds (Closed)
Patch Set: Fix is_syzyasan logic per code review comments Created 4 years, 1 month 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/compiler/BUILD.gn ('k') | no next file » | 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 2b9f7bf77373532e5cca7d033bdd5459d460279f..c36f80cca1754d7571c0fb80d0bf48aa69d76100 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -86,15 +86,32 @@ config("compiler") {
lib_dirs = [ "$clang_base_path/lib/clang/$clang_version/lib/windows" ]
}
- # Ensures that the PDB file contains FIXUP information (growing the PDB file
- # by about 5%) but does not otherwise alter the output binary. This
+ # /PROFILE ensures that the PDB file contains FIXUP information (growing the
+ # PDB file by about 5%) but does not otherwise alter the output binary. This
# information is used by the Syzygy optimization tool when decomposing the
# release image. It is enabled for syzyasan builds and opportunistically for
# other builds where it is not prohibited (not supported when incrementally
# linking, using /debug:fastlink, or building with clang).
- if (is_syzyasan ||
- (!is_debug && !is_component_build && !is_win_fastlink && !is_clang)) {
+ if (is_syzyasan) {
+ assert(!is_win_fastlink)
ldflags = [ "/PROFILE" ]
+ } else {
+ if (!is_debug && !is_component_build && !is_clang) {
+ if (is_win_fastlink) {
+ # /PROFILE implies the following linker flags. Therefore if we are
+ # skipping /PROFILE because it is incompatible with /DEBUG:FASTLINK
+ # we should explicitly add these flags in order to avoid unintended
+ # consequences such as larger binaries.
+ ldflags = [
+ "/OPT:REF",
+ "/OPT:ICF",
+ "/INCREMENTAL:NO",
+ "/FIXED:NO",
+ ]
+ } else {
+ ldflags = [ "/PROFILE" ]
+ }
+ }
}
# arflags apply only to static_libraries. The normal linker configs are only
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698