| Index: chrome/tools/build/win/syzygy/BUILD.gn
|
| diff --git a/chrome/tools/build/win/syzygy/BUILD.gn b/chrome/tools/build/win/syzygy/BUILD.gn
|
| index c73f94944a65b72f6a4b5d4eb021110f841c0cec..822a645f3e48861f54f23cc2bb265db4978cd0d7 100644
|
| --- a/chrome/tools/build/win/syzygy/BUILD.gn
|
| +++ b/chrome/tools/build/win/syzygy/BUILD.gn
|
| @@ -6,13 +6,6 @@ import("//build/config/chrome_build.gni")
|
| import("//build/config/compiler/compiler.gni")
|
| import("//build/config/sanitizers/sanitizers.gni")
|
|
|
| -declare_args() {
|
| - # Generate Syzygy optimized binaries. Syzygy optimize mode is a profile
|
| - # guided optimization that reorders code for better locality.
|
| - syzygy_optimize =
|
| - is_win && is_official_build && !is_clang && symbol_level == 2
|
| -}
|
| -
|
| assert(!syzygy_optimize || !is_syzyasan,
|
| "Don't do both syzygy_optimize and is_syzyasan")
|
|
|
| @@ -29,6 +22,9 @@ if (syzygy_optimize) {
|
| #
|
| # deps (required)
|
| # Normal meaning.
|
| + #
|
| + # data_deps
|
| + # Normal meaning.
|
| template("syzygy_optimize") {
|
| action(target_name) {
|
| if (defined(invoker.visibility)) {
|
| @@ -59,9 +55,12 @@ if (syzygy_optimize) {
|
| rebase_path(syzygy_dest_dir, root_build_dir),
|
| ]
|
|
|
| - if (defined(invoker.deps)) {
|
| - deps = invoker.deps
|
| - }
|
| + forward_variables_from(invoker,
|
| + [
|
| + "deps",
|
| + "data_deps",
|
| + "public_deps",
|
| + ])
|
| }
|
| }
|
|
|
| @@ -70,6 +69,11 @@ if (syzygy_optimize) {
|
| deps = [
|
| "//chrome:main_dll",
|
| ]
|
| + if (is_multi_dll_chrome) {
|
| + data_deps = [
|
| + ":chrome_child_dll_syzygy",
|
| + ]
|
| + }
|
| }
|
| if (is_multi_dll_chrome) {
|
| # Also instrument chrome_child.dll.
|
| @@ -83,13 +87,23 @@ if (syzygy_optimize) {
|
| } else if (is_syzyasan) {
|
| # Instruments a binary with SyzyAsan.
|
| #
|
| - # dll_name (required)
|
| - # Name of the DLL to be instrumented, with no extension or path. This
|
| - # ${dll_name}.dll is assumed to be in the output directory and must be
|
| + # 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)) {
|
| @@ -99,22 +113,23 @@ if (syzygy_optimize) {
|
|
|
| filter = "syzyasan-instrumentation-filter.txt"
|
|
|
| - dll_name = invoker.dll_name
|
| - input_dll = "$root_out_dir/$dll_name.dll"
|
| - input_pdb = "$root_out_dir/$dll_name.dll.pdb"
|
| + 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_dll,
|
| + input_image,
|
|
|
| #input_pdb,
|
| ]
|
|
|
| - output_filter = "$syzygy_dest_dir/win-syzyasan-filter-$dll_name.txt.json"
|
| + output_filter = "$dest_dir/win-syzyasan-filter-$binary_name.txt.json"
|
|
|
| outputs = [
|
| - "$syzygy_dest_dir/$dll_name.dll",
|
| - "$syzygy_dest_dir/$dll_name.dll.pdb",
|
| + "$dest_dir/$input_image",
|
| + "$dest_dir/$input_image.pdb",
|
| output_filter,
|
| ]
|
|
|
| @@ -122,7 +137,7 @@ if (syzygy_optimize) {
|
| "--mode",
|
| "asan",
|
| "--input_executable",
|
| - rebase_path(input_dll, root_build_dir),
|
| + rebase_path(input_image, root_build_dir),
|
| "--input_symbol",
|
| rebase_path(input_pdb, root_build_dir),
|
| "--filter",
|
| @@ -130,7 +145,7 @@ if (syzygy_optimize) {
|
| "--output-filter-file",
|
| rebase_path(output_filter, root_build_dir),
|
| "--destination_dir",
|
| - rebase_path(syzygy_dest_dir, root_build_dir),
|
| + rebase_path(dest_dir, root_build_dir),
|
| ]
|
|
|
| deps = [
|
| @@ -139,14 +154,17 @@ if (syzygy_optimize) {
|
| if (defined(invoker.deps)) {
|
| deps += invoker.deps
|
| }
|
| - if (defined(invoker.public_deps)) {
|
| - public_deps = invoker.public_deps
|
| - }
|
| + forward_variables_from(invoker,
|
| + [
|
| + "data_deps",
|
| + "public_deps",
|
| + ])
|
| }
|
| }
|
|
|
| syzygy_asan("chrome_dll_syzygy") {
|
| - dll_name = "chrome"
|
| + binary_name = "chrome.dll"
|
| + dest_dir = syzygy_dest_dir
|
| deps = [
|
| "//chrome:main_dll",
|
| ]
|
| @@ -160,7 +178,7 @@ if (syzygy_optimize) {
|
| # uninstrumented. Otherwise, chrome_child is also instrumented to the
|
| # normal place.
|
| syzygy_asan("chrome_child_dll_syzygy") {
|
| - dll_name = "chrome_child"
|
| + binary_name = "chrome_child.dll"
|
| deps = [
|
| "//chrome:chrome_child",
|
| ]
|
| @@ -171,6 +189,10 @@ if (syzygy_optimize) {
|
| } else {
|
| dest_dir = syzygy_dest_dir
|
| }
|
| +
|
| + data_deps = [
|
| + ":chrome_child_dll_syzygy",
|
| + ]
|
| }
|
|
|
| if (is_official_build) {
|
| @@ -182,7 +204,7 @@ if (syzygy_optimize) {
|
| "$root_out_dir/chrome_child.dll.pdb",
|
| ]
|
| outputs = [
|
| - "$syzygy_dest_dir/{{source_file_part}}",
|
| + "$dest_dir/{{source_file_part}}",
|
| ]
|
| deps = [
|
| "//chrome:chrome_child",
|
|
|