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

Side by Side Diff: chrome/BUILD.gn

Issue 2507333002: Add the possibility to build with PGO when using Clang (Closed)
Patch Set: Add the possibility to build with PGO when using Clang 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 unified diff | Download patch
« no previous file with comments | « build/config/compiler/pgo/pgo.gni ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/buildflag_header.gni") 5 import("//build/buildflag_header.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/compiler/pgo/pgo.gni")
8 import("//build/config/features.gni") 9 import("//build/config/features.gni")
9 import("//build/config/locales.gni") 10 import("//build/config/locales.gni")
10 import("//build/config/sanitizers/sanitizers.gni") 11 import("//build/config/sanitizers/sanitizers.gni")
11 import("//build/config/ui.gni") 12 import("//build/config/ui.gni")
12 import("//build/config/win/console_app.gni") 13 import("//build/config/win/console_app.gni")
13 import("//build/config/win/manifest.gni") 14 import("//build/config/win/manifest.gni")
14 import("//build/toolchain/toolchain.gni") 15 import("//build/toolchain/toolchain.gni")
15 import("//chrome/chrome_paks.gni") 16 import("//chrome/chrome_paks.gni")
16 import("//chrome/common/features.gni") 17 import("//chrome/common/features.gni")
17 import("//chrome/process_version_rc_template.gni") 18 import("//chrome/process_version_rc_template.gni")
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 110 }
110 } 111 }
111 112
112 executable("chrome_initial") { 113 executable("chrome_initial") {
113 if (is_win) { 114 if (is_win) {
114 output_name = "initialexe/chrome" 115 output_name = "initialexe/chrome"
115 } else { 116 } else {
116 output_name = "chrome" 117 output_name = "chrome"
117 } 118 }
118 119
120 if (!is_win || is_clang) {
121 # Normally, we need to pass specific flags to the linker to
122 # create an executable that gathers profile data. However, when
123 # using MSVC, we need to make sure we *don't* pass /GENPROFILE
124 # when linking without generating any code, or else the linker
125 # will give us fatal error LNK1264. So we add the PGO flags
126 # on all configurations, execpt MSVC on Windows.
127 configs += [ "//build/config/compiler/pgo:default_pgo_flags" ]
128 }
129
119 # Because the sources list varies so significantly per-platform, generally 130 # Because the sources list varies so significantly per-platform, generally
120 # each platform lists its own files rather than relying on filtering or 131 # each platform lists its own files rather than relying on filtering or
121 # removing unused files. 132 # removing unused files.
122 sources = [ 133 sources = [
123 "app/chrome_exe_resource.h", 134 "app/chrome_exe_resource.h",
124 ] 135 ]
125 defines = [] 136 defines = []
126 public_deps = [] 137 public_deps = []
127 deps = [ 138 deps = [
128 "//build/config/sanitizers:deps", 139 "//build/config/sanitizers:deps",
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 "/DELAYLOAD:wininet.dll", 428 "/DELAYLOAD:wininet.dll",
418 ] 429 ]
419 430
420 if (symbol_level == 2) { 431 if (symbol_level == 2) {
421 # Incremental linking doesn't work on this target in debug mode with 432 # Incremental linking doesn't work on this target in debug mode with
422 # full symbols, but does work in other cases, including minimal 433 # full symbols, but does work in other cases, including minimal
423 # symbols. 434 # symbols.
424 configs -= [ "//build/config/win:default_incremental_linking" ] 435 configs -= [ "//build/config/win:default_incremental_linking" ]
425 configs += [ "//build/config/win:no_incremental_linking" ] 436 configs += [ "//build/config/win:no_incremental_linking" ]
426 } 437 }
427 if (chrome_pgo_phase == 1) { 438 configs += [ "//build/config/compiler/pgo:default_pgo_flags" ]
428 ldflags += [
429 "/LTCG",
430
431 # Make sure that enough memory gets allocated for the PGO profiling
432 # buffers and also cap this memory. Usually a PGI instrumented build
433 # of chrome_child.dll requires ~55MB of memory for storing its counter
434 # etc, normally the linker should automatically choose an appropriate
435 # amount of memory but it doesn't always do a good estimate and
436 # sometime allocates too little or too much (and so the instrumented
437 # image fails to start). Making sure that the buffer has a size in the
438 # [128 MB, 512 MB] range should prevent this from happening.
439 "/GENPROFILE:MEMMIN=134217728",
440 "/GENPROFILE:MEMMAX=536870912",
441 "/PogoSafeMode",
442 ]
443 } else if (chrome_pgo_phase == 2) {
444 ldflags += [
445 "/LTCG",
446 "/USEPROFILE",
447 ]
448 }
449 439
450 if (enable_plugins && enable_pdf) { 440 if (enable_plugins && enable_pdf) {
451 deps += [ "//pdf" ] 441 deps += [ "//pdf" ]
452 } 442 }
453 } 443 }
454 } 444 }
455 copy("copy_first_run") { 445 copy("copy_first_run") {
456 sources = [ 446 sources = [
457 "app/firstRun", 447 "app/firstRun",
458 ] 448 ]
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 "//chrome/app/theme/$branding_path_component/product_logo_48.png", 1601 "//chrome/app/theme/$branding_path_component/product_logo_48.png",
1612 "//chrome/tools/build/linux/chrome-wrapper", 1602 "//chrome/tools/build/linux/chrome-wrapper",
1613 "//third_party/xdg-utils/scripts/xdg-mime", 1603 "//third_party/xdg-utils/scripts/xdg-mime",
1614 "//third_party/xdg-utils/scripts/xdg-settings", 1604 "//third_party/xdg-utils/scripts/xdg-settings",
1615 ] 1605 ]
1616 outputs = [ 1606 outputs = [
1617 "$root_out_dir/{{source_file_part}}", 1607 "$root_out_dir/{{source_file_part}}",
1618 ] 1608 ]
1619 } 1609 }
1620 } 1610 }
OLDNEW
« no previous file with comments | « build/config/compiler/pgo/pgo.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698