diff options
author | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 13:30:24 +0000 |
---|---|---|
committer | siggi@chromium.org <siggi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 13:30:24 +0000 |
commit | 3fac9271902c30d0eb7fe4db6f6870a8d2526672 (patch) | |
tree | 323341b5c1236d41db5aa2e55ca1e54ad2ec62e1 /chrome/tools | |
parent | c66b5aaf621108f64ad8c2e99629528518a0f2b7 (diff) | |
download | chromium_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/tools')
-rwxr-xr-x | chrome/tools/build/win/syzygy_instrument.py | 36 |
1 files changed, 36 insertions, 0 deletions
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 |