Home | History | Annotate | Download | only in chrome
      1 # Copyright 2013 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 # Intended to be included by chrome_syzygy.gyp. A variable 'dll_name' should
      6 # be set to the base name of the DLL. This is used to generate the build steps
      7 # for both chrome.dll and chrome_child.dll when in multiple dll mode.
      8 {
      9   # Reorder or instrument the initial chrome DLL executable, placing the
     10   # optimized output and corresponding PDB file into the "syzygy"
     11   # subdirectory.
     12   # This target won't build in fastbuild, since there are no PDBs.
     13   'dependencies': [
     14     '<(DEPTH)/chrome/chrome.gyp:<(dll_name)_dll',
     15   ],
     16   'variables': {
     17     'dest_dir': '<(PRODUCT_DIR)/syzygy',
     18   },
     19   'conditions': [
     20     ['asan!=1', {
     21       # Reorder chrome DLL executable.
     22       # If there's a matching chrome.dll-ordering.json file present in
     23       # the output directory, chrome.dll will be ordered according to
     24       # that, otherwise it will be randomized.
     25       'actions': [
     26         {
     27           'action_name': 'Reorder Chrome with Syzygy',
     28           'msvs_cygwin_shell': 0,
     29           'inputs': [
     30             '<(PRODUCT_DIR)/<(dll_name).dll',
     31             '<(PRODUCT_DIR)/<(dll_name).dll.pdb',
     32           ],
     33           'outputs': [
     34             '<(dest_dir)/<(dll_name).dll',
     35             '<(dest_dir)/<(dll_name).dll.pdb',
     36           ],
     37           'action': [
     38             'python',
     39             '<(DEPTH)/chrome/tools/build/win/syzygy_reorder.py',
     40             '--input_executable', '<(PRODUCT_DIR)/<(dll_name).dll',
     41             '--input_symbol', '<(PRODUCT_DIR)/<(dll_name).dll.pdb',
     42             '--destination_dir', '<(dest_dir)',
     43           ],
     44         },
     45       ],
     46     }, {
     47       # Instrument chrome DLL executable with SyzyAsan.
     48       'actions': [
     49         {
     50           'action_name': 'Instrument Chrome with SyzyAsan',
     51           'msvs_cygwin_shell': 0,
     52           'inputs': [
     53             '<(PRODUCT_DIR)/<(dll_name).dll',
     54             '<(PRODUCT_DIR)/<(dll_name).dll.pdb',
     55             '<(DEPTH)/chrome/tools/build/win/win-syzyasan-filter.txt',
     56           ],
     57           'outputs': [
     58             '<(dest_dir)/<(dll_name).dll',
     59             '<(dest_dir)/<(dll_name).dll.pdb',
     60             '<(dest_dir)/asan_rtl.dll',
     61             '<(dest_dir)/asan_rtl.dll.pdb',
     62             '<(dest_dir)/win-syzyasan-filter.txt.json',
     63           ],
     64           'action': [
     65             'python',
     66             '<(DEPTH)/chrome/tools/build/win/syzygy_instrument.py',
     67             '--mode', 'asan',
     68             '--input_executable', '<(PRODUCT_DIR)/<(dll_name).dll',
     69             '--input_symbol', '<(PRODUCT_DIR)/<(dll_name).dll.pdb',
     70             '--filter',
     71             '<(DEPTH)/chrome/tools/build/win/win-syzyasan-filter.txt',
     72             '--destination_dir', '<(dest_dir)',
     73           ],
     74         },
     75       ],
     76     }],
     77   ],
     78 }
     79