summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebmarchand@chromium.org <sebmarchand@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-19 15:25:54 +0000
committersebmarchand@chromium.org <sebmarchand@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-19 15:25:54 +0000
commit877090c0244312125ea8c4b0081ee7f1ca1d8100 (patch)
treea76dee765ac98447789a66ecb9732dd26793e935
parentc7a004b47e8c4532965545fb12618e9d0f5d3708 (diff)
downloadchromium_src-877090c0244312125ea8c4b0081ee7f1ca1d8100.zip
chromium_src-877090c0244312125ea8c4b0081ee7f1ca1d8100.tar.gz
chromium_src-877090c0244312125ea8c4b0081ee7f1ca1d8100.tar.bz2
Put the syzygy targets behind a 'syzygy_optimize' flag.
R=chrisha@chromium.org, pkasting@chromium.org BUG= Review URL: https://codereview.chromium.org/199633004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257972 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/all.gyp5
-rw-r--r--build/common.gypi11
-rw-r--r--chrome/chrome_syzygy.gyp121
-rw-r--r--chrome/chrome_syzygy.gypi5
4 files changed, 88 insertions, 54 deletions
diff --git a/build/all.gyp b/build/all.gyp
index 714e92b..142c4f5 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -236,7 +236,8 @@
'target_name': 'All_syzygy',
'type': 'none',
'conditions': [
- ['OS=="win" and fastbuild==0 and target_arch=="ia32"', {
+ ['OS=="win" and fastbuild==0 and target_arch=="ia32" and '
+ '(syzyasan==1 or syzygy_optimize==1)', {
'dependencies': [
'../chrome/installer/mini_installer_syzygy.gyp:*',
],
@@ -679,7 +680,7 @@
'../skia/tools/clusterfuzz-data/fuzzers/filter_fuzzer/filter_fuzzer.gyp:filter_fuzzer',
],
}], # internal_filter_fuzzer
- ['OS=="win" and fastbuild==0 and target_arch=="ia32"', {
+ ['OS=="win" and fastbuild==0 and target_arch=="ia32" and syzyasan==1', {
'dependencies': [
'../chrome/chrome_syzygy.gyp:chrome_dll_syzygy',
'../content/content_shell_and_tests.gyp:content_shell_syzyasan',
diff --git a/build/common.gypi b/build/common.gypi
index d4c8c39..e77fe9c 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -529,6 +529,9 @@
'enable_enhanced_bookmarks%': 0,
'enable_hangout_services_extension%': 0,
+ # Enable the Syzygy optimization step.
+ 'syzygy_optimize%': 0,
+
'conditions': [
# A flag for POSIX platforms
['OS=="win"', {
@@ -958,6 +961,7 @@
'asan%': '<(asan)',
'asan_coverage%': '<(asan_coverage)',
'syzyasan%': '<(syzyasan)',
+ 'syzygy_optimize%': '<(syzygy_optimize)',
'lsan%': '<(lsan)',
'msan%': '<(msan)',
'msan_blacklist%': '<(msan_blacklist)',
@@ -1307,6 +1311,13 @@
'video_hole%': 0,
'conditions': [
+ # Enable the Syzygy optimization step for the official builds.
+ ['OS=="win" and buildtype=="Official" and syzyasan!=1', {
+ 'syzygy_optimize%': 1,
+ }, {
+ 'syzygy_optimize%': 0,
+ }],
+
# The version of GCC in use, set later in platforms that use GCC and have
# not explicitly chosen to build with clang. Currently, this means all
# platforms except Windows, Mac and iOS.
diff --git a/chrome/chrome_syzygy.gyp b/chrome/chrome_syzygy.gyp
index c2c81a1..b52e702 100644
--- a/chrome/chrome_syzygy.gyp
+++ b/chrome/chrome_syzygy.gyp
@@ -32,62 +32,83 @@
],
}],
['OS=="win" and fastbuild==0', {
- 'variables': {
- 'dll_name': 'chrome',
- },
- 'targets': [
- {
- 'target_name': 'chrome_dll_syzygy',
- 'type': 'none',
- 'sources' : [],
- 'includes': [
- 'chrome_syzygy.gypi',
- ],
- },
- ],
- }],
- # Note, not else.
- ['OS=="win" and fastbuild==0 and chrome_multiple_dll==1 and '
- '(syzyasan!=1 or buildtype!="Official")', {
- 'variables': {
- 'dll_name': 'chrome_child',
- },
- 'targets': [
- {
- 'target_name': 'chrome_child_dll_syzygy',
- 'type': 'none',
- 'sources' : [],
- 'includes': [
- 'chrome_syzygy.gypi',
- ],
- },
- ],
- }, {
'conditions': [
- ['OS=="win" and fastbuild==0 and chrome_multiple_dll==1 and '
- 'syzyasan==1 and buildtype=="Official"', {
+ ['syzygy_optimize==1 or syzyasan==1', {
+ 'variables': {
+ 'dll_name': 'chrome',
+ },
'targets': [
- {
- 'target_name': 'chrome_child_dll_syzygy',
- 'type': 'none',
- 'inputs': [
- '<(PRODUCT_DIR)/chrome_child.dll',
- '<(PRODUCT_DIR)/chrome_child.dll.pdb',
- ],
- 'outputs': [
- '<(PRODUCT_DIR)/syzygy/chrome_child.dll',
- '<(PRODUCT_DIR)/syzygy/chrome_child.dll.pdb',
- ],
- 'copies': [
+ {
+ 'target_name': 'chrome_dll_syzygy',
+ 'type': 'none',
+ 'sources' : [],
+ 'includes': [
+ 'chrome_syzygy.gypi',
+ ],
+ },
+ ],
+ }],
+ ['chrome_multiple_dll==1', {
+ 'conditions': [
+ # Prevent chrome_child.dll from being syzyasan-instrumented for the
+ # official builds.
+ #
+ # Here's the truth table for this logic:
+ # +----------+-----------------+-----------+--------------+
+ # | syzyasan | syzygy_optimize | buildtype | instrument ? |
+ # +----------+-----------------+-----------+--------------+
+ # | 0 | 0 | any | N |
+ # +----------+-----------------+-----------+--------------+
+ # | 0 | 1 | any | Y |
+ # +----------+-----------------+-----------+--------------+
+ # | 1 | 0 | - | Y |
+ # +----------+-----------------+-----------+--------------+
+ # | 1 | 0 | Official | N |
+ # +----------+-----------------+-----------+--------------+
+ # | 1 | 1 | ----Invalid---- |
+ # +----------+-----------------+-----------+--------------+
+ ['(syzyasan==1 and buildtype!="Official") or syzygy_optimize==1', {
+ 'variables': {
+ 'dll_name': 'chrome_child',
+ },
+ 'targets': [
+ {
+ 'target_name': 'chrome_child_dll_syzygy',
+ 'type': 'none',
+ 'sources' : [],
+ 'includes': [
+ 'chrome_syzygy.gypi',
+ ],
+ },
+ ],
+ }],
+ # For the official SyzyASan builds just copy chrome_child.dll to the
+ # Syzygy directory.
+ ['syzyasan==1 and buildtype=="Official"', {
+ 'targets': [
{
- 'destination': '<(PRODUCT_DIR)/syzygy',
- 'files': [
+ 'target_name': 'chrome_child_dll_syzygy',
+ 'type': 'none',
+ 'inputs': [
'<(PRODUCT_DIR)/chrome_child.dll',
'<(PRODUCT_DIR)/chrome_child.dll.pdb',
],
- },
- ],
- }],
+ 'outputs': [
+ '<(PRODUCT_DIR)/syzygy/chrome_child.dll',
+ '<(PRODUCT_DIR)/syzygy/chrome_child.dll.pdb',
+ ],
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/syzygy',
+ 'files': [
+ '<(PRODUCT_DIR)/chrome_child.dll',
+ '<(PRODUCT_DIR)/chrome_child.dll.pdb',
+ ],
+ },
+ ],
+ }],
+ }],
+ ],
}],
],
}],
diff --git a/chrome/chrome_syzygy.gypi b/chrome/chrome_syzygy.gypi
index a5273ba..eae8e4b 100644
--- a/chrome/chrome_syzygy.gypi
+++ b/chrome/chrome_syzygy.gypi
@@ -17,7 +17,7 @@
'dest_dir': '<(PRODUCT_DIR)/syzygy',
},
'conditions': [
- ['syzyasan!=1', {
+ ['syzyasan==0 and syzygy_optimize==1', {
# Reorder chrome DLL executable.
# If there's a matching chrome.dll-ordering.json file present in
# the output directory, chrome.dll will be ordered according to
@@ -42,7 +42,8 @@
],
},
],
- }, {
+ }],
+ ['syzyasan==1 and syzygy_optimize==0', {
# Instrument chrome DLL executable with SyzyAsan.
'actions': [
{