summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsiggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-12 13:30:24 +0000
committersiggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-12 13:30:24 +0000
commit3fac9271902c30d0eb7fe4db6f6870a8d2526672 (patch)
tree323341b5c1236d41db5aa2e55ca1e54ad2ec62e1 /chrome
parentc66b5aaf621108f64ad8c2e99629528518a0f2b7 (diff)
downloadchromium_src-3fac9271902c30d0eb7fe4db6f6870a8d2526672.zip
chromium_src-3fac9271902c30d0eb7fe4db6f6870a8d2526672.tar.gz
chromium_src-3fac9271902c30d0eb7fe4db6f6870a8d2526672.tar.bz2
Revert 222650 "Copy asan_rtl.* and agent_logger.exe to the syzyg..."
The change breaks the official ASAN Canaries. BUG=290090 NOTRY=true > Copy asan_rtl.* and agent_logger.exe to the syzygy directory for the ASan builds. > > Currently the syzygy_optimize script was taking care of copying asan_rtl.[dll|pdb] to the syzygy directory, this was causing 2 warnings when building a SyzyASan splitted build with ninja: > > - ninja: warning: multiple rules generate syzygy\asan_rtl.dll. builds involving this target will not be correct; continuing anyway > - ninja: warning: multiple rules generate syzygy\asan_rtl.dll.pdb. builds involving this target will not be correct; continuing anyway > > The multiple rules come from the fact that both syzygy\chrome.dll and syzygy\chrome_child.dll were trying to generate those artifacts. > > I've also added agent_logger.exe to the syzygy directory, with this it'll be easier for the person grabing a SyzyASan build from the LKGR builder to use it. > > I've also removed all the "--agent-dll" logic from syzygy_instrument.py as it was only copying the asan binaries to the syzygy directory, it's now done directly in the 'copy_syzyasan_binaries' gyp target. > > R=chrisha@chromium.org > BUG= > > Review URL: https://chromiumcodereview.appspot.com/23460023 TBR=sebmarchand@chromium.org Review URL: https://codereview.chromium.org/23858006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/chrome_syzygy.gyp28
-rw-r--r--chrome/chrome_syzygy.gypi10
-rwxr-xr-xchrome/tools/build/win/syzygy_instrument.py36
3 files changed, 39 insertions, 35 deletions
diff --git a/chrome/chrome_syzygy.gyp b/chrome/chrome_syzygy.gyp
index 80fe87d..0801d18 100644
--- a/chrome/chrome_syzygy.gyp
+++ b/chrome/chrome_syzygy.gyp
@@ -63,33 +63,5 @@
}],
],
}],
- ['OS=="win" and asan==1', {
- 'variables': {
- 'dest_dir': '<(PRODUCT_DIR)/syzygy',
- 'syzygy_exe_dir': '<(DEPTH)/third_party/syzygy/binaries/exe',
- },
- # Copy the SyzyASan runtime and logger to the syzygy directory.
- 'targets': [
- {
- 'target_name': 'copy_syzyasan_binaries',
- 'type': 'none',
- 'outputs': [
- '<(dest_dir)/agent_logger.exe',
- '<(dest_dir)/asan_rtl.dll',
- '<(dest_dir)/asan_rtl.dll.pdb',
- ],
- 'copies': [
- {
- 'destination': '<(dest_dir)',
- 'files': [
- '<(syzygy_exe_dir)/agent_logger.exe',
- '<(syzygy_exe_dir)/asan_rtl.dll',
- '<(syzygy_exe_dir)/asan_rtl.dll.pdb',
- ],
- },
- ],
- },
- ],
- }],
],
}
diff --git a/chrome/chrome_syzygy.gypi b/chrome/chrome_syzygy.gypi
index f4e3a81..a3201cc 100644
--- a/chrome/chrome_syzygy.gypi
+++ b/chrome/chrome_syzygy.gypi
@@ -50,20 +50,16 @@
'action_name': 'Instrument Chrome with SyzyAsan',
'msvs_cygwin_shell': 0,
'inputs': [
- '<(DEPTH)/chrome/tools/build/win/win-syzyasan-filter.txt',
- '<(dest_dir)/asan_rtl.dll',
- '<(dest_dir)/asan_rtl.dll.pdb',
- '<(dest_dir)/agent_logger.exe',
'<(PRODUCT_DIR)/<(dll_name).dll',
+ '<(DEPTH)/chrome/tools/build/win/win-syzyasan-filter.txt',
],
'outputs': [
'<(dest_dir)/<(dll_name).dll',
'<(dest_dir)/<(dll_name).dll.pdb',
+ '<(dest_dir)/asan_rtl.dll',
+ '<(dest_dir)/asan_rtl.dll.pdb',
'<(dest_dir)/win-syzyasan-filter-<(dll_name).txt.json',
],
- 'dependencies': [
- '<(DEPTH)/chrome/chrome_syzygy.gyp:copy_syzyasan_binaries',
- ],
'action': [
'python',
'<(DEPTH)/chrome/tools/build/win/syzygy_instrument.py',
diff --git a/chrome/tools/build/win/syzygy_instrument.py b/chrome/tools/build/win/syzygy_instrument.py
index ae6558e..dfde310 100755
--- a/chrome/tools/build/win/syzygy_instrument.py
+++ b/chrome/tools/build/win/syzygy_instrument.py
@@ -22,6 +22,10 @@ _DEFAULT_SYZYGY_DIR = os.path.abspath(os.path.join(
# Basenames of various tools.
_INSTRUMENT_EXE = 'instrument.exe'
_GENFILTER_EXE = 'genfilter.exe'
+_ASAN_AGENT_DLL = 'asan_rtl.dll'
+
+# Default agents for known modes.
+_DEFAULT_AGENT_DLLS = { 'asan': _ASAN_AGENT_DLL }
_LOGGER = logging.getLogger()
@@ -83,6 +87,24 @@ def _InstrumentBinary(syzygy_dir, mode, executable, symbol, dst_dir,
return _Shell(*cmd)
+def _CopyAgentDLL(agent_dll, destination_dir):
+ """Copy the agent DLL and PDB to the destination directory."""
+ dirname, agent_name = os.path.split(agent_dll);
+ agent_dst_name = os.path.join(destination_dir, agent_name);
+ shutil.copyfile(agent_dll, agent_dst_name)
+
+ # Search for the corresponding PDB file. We use this approach because
+ # the naming convention for PDBs has changed recently (from 'foo.pdb'
+ # to 'foo.dll.pdb') and we want to support both conventions during the
+ # transition.
+ agent_pdbs = glob.glob(os.path.splitext(agent_dll)[0] + '*.pdb')
+ if len(agent_pdbs) != 1:
+ raise RuntimeError('Failed to locate PDB file for %s' % agent_name)
+ agent_pdb = agent_pdbs[0]
+ agent_dst_pdb = os.path.join(destination_dir, os.path.split(agent_pdb)[1])
+ shutil.copyfile(agent_pdb, agent_dst_pdb)
+
+
def main(options):
# Make sure the destination directory exists.
if not os.path.isdir(options.destination_dir):
@@ -106,6 +128,9 @@ def main(options):
options.destination_dir,
options.output_filter_file)
+ # Copy the agent DLL and PDB to the destination directory.
+ _CopyAgentDLL(options.agent_dll, options.destination_dir);
+
def _ParseOptions():
option_parser = optparse.OptionParser()
@@ -115,6 +140,9 @@ def _ParseOptions():
help='The path to the input symbol file.')
option_parser.add_option('--mode',
help='Specifies which instrumentation mode is to be used.')
+ option_parser.add_option('--agent_dll',
+ help='The agent DLL used by this instrumentation. If not specified a '
+ 'default will be searched for.')
option_parser.add_option('--syzygy-dir', default=_DEFAULT_SYZYGY_DIR,
help='Instrumenter executable to use, defaults to "%default".')
option_parser.add_option('-d', '--destination_dir',
@@ -138,6 +166,14 @@ def _ParseOptions():
if options.filter and not options.output_filter_file:
option_parser.error('You must provide a filter output file.')
+ if not options.agent_dll:
+ if not options.mode in _DEFAULT_AGENT_DLLS:
+ option_parser.error('No known default agent DLL for mode "%s".' %
+ options.mode)
+ options.agent_dll = os.path.abspath(os.path.join(options.syzygy_dir,
+ _DEFAULT_AGENT_DLLS[options.mode]))
+ _LOGGER.info('Using default agent DLL: %s' % options.agent_dll)
+
return options