Commit cc11d0ef authored by ochang's avatar ochang Committed by Commit bot

GN configs for ipc fuzzer.

Also removes an unneeded dep from message_lib.gyp.

BUG=605926

Review URL: https://codereview.chromium.org/1916493003

Cr-Commit-Position: refs/heads/master@{#389861}
parent 131c20ce
...@@ -103,6 +103,7 @@ group("both_gn_and_gyp") { ...@@ -103,6 +103,7 @@ group("both_gn_and_gyp") {
"//skia:skia_unittests", "//skia:skia_unittests",
"//sql:sql_unittests", "//sql:sql_unittests",
"//sync:sync_unit_tests", "//sync:sync_unit_tests",
"//tools/ipc_fuzzer:ipc_fuzzer_all",
"//ui/base:ui_base_unittests", "//ui/base:ui_base_unittests",
"//ui/gfx:gfx_unittests", "//ui/gfx:gfx_unittests",
"//url:url_unittests", "//url:url_unittests",
......
...@@ -10,6 +10,7 @@ import("//chrome/common/features.gni") ...@@ -10,6 +10,7 @@ import("//chrome/common/features.gni")
import("//media/media_options.gni") import("//media/media_options.gni")
import("//third_party/kasko/kasko.gni") import("//third_party/kasko/kasko.gni")
import("//third_party/protobuf/proto_library.gni") import("//third_party/protobuf/proto_library.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
# //build/config/android/rules.gni imports //tools/grit/grit_rule.gni, which # //build/config/android/rules.gni imports //tools/grit/grit_rule.gni, which
# produces a conflict for the "grit" template so we have to only include one. # produces a conflict for the "grit" template so we have to only include one.
...@@ -970,6 +971,10 @@ source_set("browser") { ...@@ -970,6 +971,10 @@ source_set("browser") {
"chrome_browser_main_extra_parts_exo.h", "chrome_browser_main_extra_parts_exo.h",
] ]
} }
if (enable_ipc_fuzzer) {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
}
} }
if (android_java_ui) { if (android_java_ui) {
......
...@@ -7,6 +7,7 @@ import("//chrome/common/features.gni") ...@@ -7,6 +7,7 @@ import("//chrome/common/features.gni")
import("//chrome/version.gni") import("//chrome/version.gni")
import("//mojo/public/tools/bindings/mojom.gni") import("//mojo/public/tools/bindings/mojom.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
gypi_values = exec_script("//build/gypi_to_gn.py", gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../chrome_common.gypi") ], [ rebase_path("../chrome_common.gypi") ],
...@@ -281,6 +282,14 @@ static_library("common") { ...@@ -281,6 +282,14 @@ static_library("common") {
".", ".",
"//chrome") "//chrome")
} }
if (enable_ipc_fuzzer) {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
sources += [
"external_ipc_dumper.cc",
"external_ipc_dumper.h",
]
}
} }
# GYP version: chrome/common_constants.gyp:version_header # GYP version: chrome/common_constants.gyp:version_header
...@@ -349,6 +358,10 @@ static_library("constants") { ...@@ -349,6 +358,10 @@ static_library("constants") {
# implemented in //ui/base, so we need that dependency. # implemented in //ui/base, so we need that dependency.
deps += [ "//ui/base" ] deps += [ "//ui/base" ]
} }
if (enable_ipc_fuzzer) {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
}
} }
if (is_win) { if (is_win) {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import("//build/config/features.gni") import("//build/config/features.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
gypi_values = exec_script("//build/gypi_to_gn.py", gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../chrome_renderer.gypi") ], [ rebase_path("../chrome_renderer.gypi") ],
...@@ -181,6 +182,10 @@ static_library("renderer") { ...@@ -181,6 +182,10 @@ static_library("renderer") {
"spellchecker/hunspell_engine.h", "spellchecker/hunspell_engine.h",
] ]
} }
if (enable_ipc_fuzzer) {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
}
} }
# In GYP this is part of test_support_common. # In GYP this is part of test_support_common.
......
...@@ -18,6 +18,7 @@ source_set("child") { ...@@ -18,6 +18,7 @@ source_set("child") {
"//content/public/child:child_sources", "//content/public/child:child_sources",
"//content/renderer/*", "//content/renderer/*",
"//content/utility/*", "//content/utility/*",
"//tools/ipc_fuzzer/*",
] ]
sources = rebase_path(content_child_gypi_values.private_child_sources, sources = rebase_path(content_child_gypi_values.private_child_sources,
......
...@@ -13,7 +13,8 @@ contribute. ...@@ -13,7 +13,8 @@ contribute.
### Build instructions ### Build instructions
* add `enable_ipc_fuzzer=1` to `GYP_DEFINES` * Run `gn args` and add `enable_ipc_fuzzer = true` to your args.gn. If you use
GYP, add `enable_ipc_fuzzer=1` to `GYP_DEFINES`.
* build `ipc_fuzzer_all` target * build `ipc_fuzzer_all` target
* component builds are currently broken, sorry * component builds are currently broken, sorry
* Debug builds are broken; only Release mode works. * Debug builds are broken; only Release mode works.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import("//build/config/nacl/config.gni") import("//build/config/nacl/config.gni")
import("//testing/test.gni") import("//testing/test.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
assert(!is_ios) assert(!is_ios)
...@@ -141,6 +142,10 @@ component("ipc") { ...@@ -141,6 +142,10 @@ component("ipc") {
# On Mac MachPortAttachmentMac needs to generate random IDs. # On Mac MachPortAttachmentMac needs to generate random IDs.
deps += [ "//crypto" ] deps += [ "//crypto" ]
} }
if (enable_ipc_fuzzer) {
public_configs = [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ]
}
} }
# This is provided as a separate target so other targets can provide param # This is provided as a separate target so other targets can provide param
......
# 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.
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
config("ipc_fuzzer_config") {
defines = [ "ENABLE_IPC_FUZZER" ]
}
config("ipc_fuzzer_tool_config") {
defines = [
"ENABLE_IPC_FUZZER",
"USE_CUPS",
]
include_dirs = [ "." ]
}
if (enable_ipc_fuzzer && (is_linux || is_mac || is_win)) {
assert(!is_component_build, "IPC fuzzer does not support component builds.")
group("ipc_fuzzer_all") {
deps = [
"//tools/ipc_fuzzer/fuzzer:ipc_fuzzer",
"//tools/ipc_fuzzer/message_dump:ipc_message_dump",
"//tools/ipc_fuzzer/message_replay:ipc_fuzzer_replay",
"//tools/ipc_fuzzer/message_tools:ipc_message_list",
"//tools/ipc_fuzzer/message_tools:ipc_message_util",
]
}
} else {
group("ipc_fuzzer_all") {
}
}
# 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.
import("//build/config/sanitizers/sanitizers.gni")
executable("ipc_fuzzer") {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_tool_config" ]
sources = [
"fuzzer.cc",
"fuzzer.h",
"fuzzer_main.cc",
"generator.cc",
"generator.h",
"mutator.cc",
"mutator.h",
"rand_util.cc",
"rand_util.h",
]
deps = [
"//tools/ipc_fuzzer/message_lib:ipc_message_lib",
]
if (is_asan && is_chromeos) {
# Compiling fuzzer.cc with ASan takes too long, see
# http://crbug.com/360158.
config -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
}
}
# 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.
declare_args() {
# Don't build IPC fuzzer by default.
enable_ipc_fuzzer = false
}
# 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.
loadable_module("ipc_message_dump") {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_tool_config" ]
deps = [
"//tools/ipc_fuzzer/message_lib:ipc_message_lib",
]
sources = [
"message_dump.cc",
]
}
# 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.
static_library("ipc_message_lib") {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_tool_config" ]
public_deps = [
"//base",
"//chrome/common",
"//chrome/common/safe_browsing:proto",
"//components/content_settings/content/common",
"//components/nacl/common",
"//components/network_hints/common",
"//components/pdf/common",
"//content/child",
"//content/public/child",
"//ipc",
"//media/cast:net",
"//ppapi/proxy:ipc",
"//skia",
"//third_party/WebKit/public:blink",
"//third_party/WebKit/public:blink_headers",
"//third_party/libjingle",
"//third_party/mt19937ar",
"//ui/accessibility:ax_gen",
]
sources = [
"all_messages.h",
"message_cracker.h",
"message_file.h",
"message_file_format.h",
"message_file_reader.cc",
"message_file_writer.cc",
"message_names.cc",
"message_names.h",
]
}
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
'../../../ipc/ipc.gyp:ipc', '../../../ipc/ipc.gyp:ipc',
'../../../media/cast/cast.gyp:cast_net', '../../../media/cast/cast.gyp:cast_net',
'../../../ppapi/ppapi_internal.gyp:ppapi_ipc', '../../../ppapi/ppapi_internal.gyp:ppapi_ipc',
'../../../remoting/remoting.gyp:remoting_host',
'../../../skia/skia.gyp:skia', '../../../skia/skia.gyp:skia',
'../../../third_party/libjingle/libjingle.gyp:libjingle', '../../../third_party/libjingle/libjingle.gyp:libjingle',
'../../../third_party/mt19937ar/mt19937ar.gyp:mt19937ar', '../../../third_party/mt19937ar/mt19937ar.gyp:mt19937ar',
......
# 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.
executable("ipc_fuzzer_replay") {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_tool_config" ]
deps = [
"//ipc/mojo",
"//tools/ipc_fuzzer/message_lib:ipc_message_lib",
]
sources = [
"replay.cc",
"replay_process.cc",
"replay_process.h",
]
}
# 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.
executable("ipc_message_util") {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_tool_config" ]
deps = [
"//third_party/re2",
"//tools/ipc_fuzzer/message_lib:ipc_message_lib",
]
sources = [
"message_util.cc",
]
}
executable("ipc_message_list") {
configs += [ "//tools/ipc_fuzzer:ipc_fuzzer_tool_config" ]
deps = [
"//chrome/common/safe_browsing:proto",
"//tools/ipc_fuzzer/message_lib:ipc_message_lib",
]
sources = [
"message_list.cc",
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment