summaryrefslogtreecommitdiff
path: root/testing/fuzzers
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-11 17:10:03 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-11 17:10:03 +0000
commite47f1079d085d6f62d9f48a035666e7ced4b76bc (patch)
treeb75098859b23001c58525db4b3d23e28587ca24f /testing/fuzzers
parentdbaf3b834c51286d5ef49fd13ba943d926bd9832 (diff)
downloadpdfium-e47f1079d085d6f62d9f48a035666e7ced4b76bc.tar.xz
Enable jumbo support for PDFium fuzzers.
Make fuzzer helpers that are mutually exclusive use the same name for their global variables. If any target tries to include both, the jumbo build will likely fail. BUG=pdfium:964 Change-Id: Idadbc86ff990bf1e8c7cfb3500f1f191a96432db Reviewed-on: https://pdfium-review.googlesource.com/c/43850 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/fuzzers')
-rw-r--r--testing/fuzzers/BUILD.gn5
-rw-r--r--testing/fuzzers/pdf_fuzzer_init.cc6
-rw-r--r--testing/fuzzers/pdfium_fuzzer_helper.cc5
3 files changed, 12 insertions, 4 deletions
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index f528ad5c9d..94f501ad65 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/jumbo.gni")
import("../../pdfium.gni")
config("fuzzer_config") {
@@ -66,7 +67,7 @@ group("fuzzers") {
}
template("pdfium_public_fuzzer") {
- source_set(target_name) {
+ jumbo_source_set(target_name) {
sources = invoker.sources + [
"pdfium_fuzzer_helper.cc",
"pdfium_fuzzer_helper.h",
@@ -95,7 +96,7 @@ template("pdfium_public_fuzzer") {
}
template("pdfium_fuzzer") {
- source_set(target_name) {
+ jumbo_source_set(target_name) {
sources = invoker.sources + [ "pdf_fuzzer_init.cc" ]
deps = [
"../../:pdfium",
diff --git a/testing/fuzzers/pdf_fuzzer_init.cc b/testing/fuzzers/pdf_fuzzer_init.cc
index 4b9790c3f8..d6b10ff00e 100644
--- a/testing/fuzzers/pdf_fuzzer_init.cc
+++ b/testing/fuzzers/pdf_fuzzer_init.cc
@@ -18,4 +18,8 @@ struct TestCase {
}
FPDF_LIBRARY_CONFIG config;
};
-static TestCase* testCase = new TestCase();
+
+// pdf_fuzzer_init.cc and pdfium_fuzzer_helper.cc are mutually exclusive and
+// should not be built together. They deliberately have the same global
+// variable.
+static TestCase* g_test_case = new TestCase();
diff --git a/testing/fuzzers/pdfium_fuzzer_helper.cc b/testing/fuzzers/pdfium_fuzzer_helper.cc
index ed000d251d..0315916d0c 100644
--- a/testing/fuzzers/pdfium_fuzzer_helper.cc
+++ b/testing/fuzzers/pdfium_fuzzer_helper.cc
@@ -261,4 +261,7 @@ struct TestCase {
UNSUPPORT_INFO unsupport_info;
};
-static TestCase* test_case = new TestCase();
+// pdf_fuzzer_init.cc and pdfium_fuzzer_helper.cc are mutually exclusive and
+// should not be built together. They deliberately have the same global
+// variable.
+static TestCase* g_test_case = new TestCase();