Commit 51ce0e17 authored by rogerm@google.com's avatar rogerm@google.com

Integrate syzygy (optionally) into the chrome build process.

Review URL: http://codereview.chromium.org/7464040

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95620 0039d316-1c4b-4281-b951-d872f2087c98
parent ce8a26c7
...@@ -312,6 +312,11 @@ deps_os = { ...@@ -312,6 +312,11 @@ deps_os = {
# Dependencies used by libjpeg-turbo # Dependencies used by libjpeg-turbo
"src/third_party/yasm/binaries": "src/third_party/yasm/binaries":
"/trunk/deps/third_party/yasm/binaries@74228", "/trunk/deps/third_party/yasm/binaries@74228",
# Binary level profile guided optimizations. This points to the
# latest release binaries for the toolchain.
"src/third_party/syzygy/binaries":
"https://sawbuck.googlecode.com/svn/trunk/syzygy/binaries@394",
}, },
"mac": { "mac": {
"src/chrome/tools/test/reference_build/chrome_mac": "src/chrome/tools/test/reference_build/chrome_mac":
......
...@@ -129,6 +129,7 @@ ...@@ -129,6 +129,7 @@
'chrome_common.gypi', 'chrome_common.gypi',
'chrome_dll.gypi', 'chrome_dll.gypi',
'chrome_exe.gypi', 'chrome_exe.gypi',
'chrome_dll_syzygy.gypi', # This must follow chrome_dll and chrome_exe.
'chrome_installer.gypi', 'chrome_installer.gypi',
'chrome_installer_util.gypi', 'chrome_installer_util.gypi',
'chrome_renderer.gypi', 'chrome_renderer.gypi',
......
...@@ -63,11 +63,24 @@ ...@@ -63,11 +63,24 @@
['OS=="mac" or OS=="win"', { ['OS=="mac" or OS=="win"', {
'targets': [ 'targets': [
{ {
'target_name': 'chrome_dll',
'type': 'shared_library',
'variables': { 'variables': {
'chrome_dll_target': 1, 'chrome_dll_target': 1,
'conditions' : [
['OS=="win"', {
# On Windows we use build chrome_dll as an intermediate target
# then have a subsequent step which either optimizes it to its
# final location, or copies it to its final location, depending
# on whether or not optimize_with_syzygy==1. Please, refer to
# chrome_dll_syzygy.gypi for the subsequent defintion of the
# Windows chrome_dll target.
'dll_target_name': 'chrome_dll_initial',
}, {
'dll_target_name': 'chrome_dll',
}],
],
}, },
'target_name': '<(dll_target_name)',
'type': 'shared_library',
'dependencies': [ 'dependencies': [
'<@(chromium_dependencies)', '<@(chromium_dependencies)',
'app/policy/cloud_policy_codegen.gyp:policy', 'app/policy/cloud_policy_codegen.gyp:policy',
...@@ -133,7 +146,21 @@ ...@@ -133,7 +146,21 @@
'msvs_settings': { 'msvs_settings': {
'VCLinkerTool': { 'VCLinkerTool': {
'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib', 'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
'ProgramDatabaseFile': '$(OutDir)\\chrome_dll.pdb', # On Windows we use build chrome_dll as an intermediate target
# then have a subsequent step which either optimizes it to its
# final location, or copies it to its final location, based
# on whether or not optimize_with_syzygy==1.
'ProgramDatabaseFile': '$(OutDir)\\initial\\chrome_dll.pdb',
'OutputFile': '$(OutDir)\\initial\\chrome.dll',
'conditions': [
['fastbuild==0', {
# This corresponds to the /PROFILE flag which ensures the PDB
# file contains FIXUP information. This information is used
# by the Syzygy optimization tool. Syzygy optimization is
# disabled when fastbuild!=0.
'Profile': 'true',
}],
],
}, },
}, },
}], # OS=="win" }], # OS=="win"
......
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'optimize_with_syzygy%': 0,
},
'conditions': [
['OS=="win"', {
'targets': [
{
'target_name': 'chrome_dll',
'type': 'none',
'sources' : [],
'dependencies': [
'chrome_dll_initial',
'chrome',
],
'conditions': [
['optimize_with_syzygy==1 and fastbuild==0', {
# Optimize the initial chrome DLL file, placing the optimized
# output and corresponding PDB file into the product directory.
# If fastbuild!=0 then no PDB files are generated by the build
# and the syzygy optimizations cannot run (they use the PDB
# information to properly understand the DLLs contents), so
# syzygy optimization cannot be performed.
'actions': [
{
'action_name': 'Optimize Chrome binaries with syzygy',
'msvs_cygwin_shell': 0,
'inputs': [
'<(PRODUCT_DIR)\\initial\\chrome.dll',
'<(PRODUCT_DIR)\\initial\\chrome_dll.pdb',
],
'outputs': [
'<(PRODUCT_DIR)\\chrome.dll',
'<(PRODUCT_DIR)\\chrome_dll.pdb',
],
'action': [
'<(DEPTH)\\third_party\\syzygy\\binaries\\optimize.bat',
'--verbose',
'--input-dir="<(PRODUCT_DIR)"',
'--input-dll="<(PRODUCT_DIR)\\initial\\chrome.dll"',
'--input-pdb="<(PRODUCT_DIR)\\initial\\chrome_dll.pdb"',
'--output-dir="<(INTERMEDIATE_DIR)\\optimized"',
'--copy-to="<(PRODUCT_DIR)"',
],
},
],
}, { # optimize_with_syzygy!=1 or fastbuild!=0
# Copy the chrome DLL and PDB files into the product directory.
# If fastbuild!= 0 then there is no PDB file to copy.
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'conditions': [
['fastbuild==0', {
'files': [
'<(PRODUCT_DIR)\\initial\\chrome.dll',
'<(PRODUCT_DIR)\\initial\\chrome_dll.pdb',
],
}, {
'files': [
'<(PRODUCT_DIR)\\initial\\chrome.dll',
],
}],
],
},
],
}], # optimize_with_syzygy==0 or fastbuild==1
], # conditions
},
],
}],
],
}
...@@ -420,15 +420,21 @@ ...@@ -420,15 +420,21 @@
'../third_party/adobe/flash/flash_player.gyp:flash_player', '../third_party/adobe/flash/flash_player.gyp:flash_player',
], ],
}], }],
['OS=="mac" or OS=="win"', { ['OS=="mac"', {
'dependencies': [ 'dependencies': [
# On Windows and Mac, make sure we've built chrome_dll, which # On Mac, make sure we've built chrome_dll, which contains all of
# contains all of the library code with Chromium functionality. # the library code with Chromium functionality.
'chrome_dll', 'chrome_dll',
], ],
}], }],
['OS=="win"', { ['OS=="win"', {
'dependencies': [ 'dependencies': [
# On Windows there is an intermediate target which builds an
# initial version of chrome_dll, then either optimizes it or
# copies to its final location. The optimization step also
# depends on chrome_exe, so here we depend on the initial
# chrome_dll.
'chrome_dll_initial',
'chrome_version_resources', 'chrome_version_resources',
'installer_util', 'installer_util',
'installer_util_strings', 'installer_util_strings',
......
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