forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the Syzygy scripts out of //chrome/
Also move the syzygy_optimize and syzygy_asan GN templates to //build/win/syzygy so they can be reused in //content (without adding a dependency with //chrome). BUG=619086 Review-Url: https://codereview.chromium.org/2126673002 Cr-Commit-Position: refs/heads/master@{#404503}
- Loading branch information
1 parent
7cb1503
commit 71a43ca
Showing
11 changed files
with
180 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2016 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. | ||
|
||
copy("copy_syzyasan_binaries") { | ||
visibility = [ | ||
"//chrome/*", | ||
"//content/*", | ||
] | ||
|
||
source_dir = "//third_party/syzygy/binaries/exe" | ||
|
||
sources = [ | ||
"$source_dir/agent_logger.exe", | ||
"$source_dir/minidump_symbolizer.py", | ||
"$source_dir/syzyasan_rtl.dll", | ||
"$source_dir/syzyasan_rtl.dll.pdb", | ||
] | ||
|
||
outputs = [ | ||
"$root_out_dir/syzygy/{{source_file_part}}", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
chrisha@chromium.org | ||
sebmarchand@chromiun.org | ||
siggi@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# Copyright 2016 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. | ||
|
||
assert(is_win) | ||
|
||
# Where the output binaries will be placed. | ||
syzygy_dest_dir = "$root_out_dir/syzygy" | ||
|
||
# Generates a Syzygy optimize target. | ||
# | ||
# binary_name (required) | ||
# Name of the binary to be instrumented, with no extension or path. This | ||
# binary_name is assumed to be in the output directory and must be | ||
# generated by a dependency of this target. | ||
# | ||
# deps (required) | ||
# Normal meaning. | ||
# | ||
# data_deps | ||
# Normal meaning. | ||
template("syzygy_optimize") { | ||
action(target_name) { | ||
if (defined(invoker.visibility)) { | ||
visibility = invoker.visibility | ||
} | ||
script = "//build/win/syzygy/reorder.py" | ||
|
||
binary_name = invoker.binary_name | ||
input_dll = "$root_out_dir/$binary_name" | ||
input_pdb = "$root_out_dir/$binary_name.pdb" | ||
|
||
inputs = [ | ||
input_dll, | ||
#input_pdb, | ||
] | ||
|
||
outputs = [ | ||
"$syzygy_dest_dir/$binary_name", | ||
"$syzygy_dest_dir/$binary_name.pdb", | ||
] | ||
|
||
args = [ | ||
"--input_executable", | ||
rebase_path(input_dll, root_build_dir), | ||
"--input_symbol", | ||
rebase_path(input_pdb, root_build_dir), | ||
"--destination_dir", | ||
rebase_path(syzygy_dest_dir, root_build_dir), | ||
] | ||
|
||
forward_variables_from(invoker, | ||
[ | ||
"deps", | ||
"data_deps", | ||
"public_deps", | ||
]) | ||
} | ||
} | ||
|
||
# Instruments a binary with SyzyAsan. | ||
# | ||
# binary_name (required) | ||
# Name of the binary to be instrumented, with no extension or path. This | ||
# binary_name is assumed to be in the output directory and must be | ||
# generated by a dependency of this target. | ||
# | ||
# dest_dir (required) | ||
# The destination directory where the instrumented image should be | ||
# written. | ||
# | ||
# deps (required) | ||
# Normal meaning. | ||
# | ||
# public_deps | ||
# Normal meaning. | ||
# | ||
# data_deps | ||
# Normal meaning. | ||
template("syzygy_asan") { | ||
action(target_name) { | ||
if (defined(invoker.visibility)) { | ||
visibility = invoker.visibility | ||
} | ||
script = "//build/win/syzygy/instrument.py" | ||
|
||
filter = "//build/win/syzygy/syzyasan-instrumentation-filter.txt" | ||
|
||
binary_name = invoker.binary_name | ||
dest_dir = invoker.dest_dir | ||
input_image = "$root_out_dir/$binary_name" | ||
input_pdb = "$root_out_dir/$binary_name.pdb" | ||
|
||
inputs = [ | ||
filter, | ||
input_image, | ||
|
||
#input_pdb, | ||
] | ||
|
||
output_filter = "$dest_dir/win-syzyasan-filter-$binary_name.txt.json" | ||
|
||
outputs = [ | ||
"$dest_dir/$binary_name", | ||
"$dest_dir/$binary_name.pdb", | ||
output_filter, | ||
] | ||
|
||
args = [ | ||
"--mode", | ||
"asan", | ||
"--input_executable", | ||
rebase_path(input_image, root_build_dir), | ||
"--input_symbol", | ||
rebase_path(input_pdb, root_build_dir), | ||
"--filter", | ||
rebase_path(filter, root_build_dir), | ||
"--output-filter-file", | ||
rebase_path(output_filter, root_build_dir), | ||
"--destination_dir", | ||
rebase_path(dest_dir, root_build_dir), | ||
] | ||
|
||
deps = [ | ||
"//build/win/syzygy:copy_syzyasan_binaries", | ||
] | ||
if (defined(invoker.deps)) { | ||
deps += invoker.deps | ||
} | ||
forward_variables_from(invoker, | ||
[ | ||
"data_deps", | ||
"public_deps", | ||
"testonly", | ||
]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.