Revert "[Reland] Switch pdfium target from a static library to a component"
This reverts commit d7e5b1d7b0aa352af9d30d5d9410c8d352a483ba.
Reason for revert: Causing clusterfuzz failures
Original change's description:
> [Reland] Switch pdfium target from a static library to a component
>
> Reland fixes linker failures, verified by Chromium's CQ:
> https://chromium-review.googlesource.com/c/chromium/src/+/1590226
>
> Reduces size of build directory by 206 MiB (-1.0%) when building "all"
> with gn args "use_goma=true is_component_build=true is_debug=false
> enable_nacl=false symbol_level=1". Build time also reduced from
> 426.111s to 405.252s, though I only took one sample.
>
> Also added some missing dependencies that were causing linker failures
> in component builds.
>
> BUG=chromium:941663
> R=thestig
>
> Change-Id: Ie5d71a50741e0c4f57554b29816e89cf43fffdc6
> Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/53731
> Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
> Commit-Queue: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
TBR=thestig@chromium.org,thomasanderson@chromium.org
Change-Id: Id664f2dbe6a4669220c3dd7955e983f76ef6a012
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:941663
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/53810
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 65a8597..83fc631 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -129,7 +129,7 @@
public_configs = [ ":pdfium_public_config" ]
}
-jumbo_component("pdfium") {
+jumbo_static_library("pdfium") {
sources = [
"fpdfsdk/fpdf_annot.cpp",
"fpdfsdk/fpdf_attachment.cpp",
@@ -184,8 +184,6 @@
"core/fxcrt",
]
- defines = [ "FPDF_IMPLEMENTATION" ]
-
if (pdf_enable_xfa) {
deps += [
"fpdfsdk/fpdfxfa",
@@ -361,7 +359,6 @@
]
deps = [
":pdfium",
- "core/fxcrt",
"testing/image_diff",
"//build/win:default_exe_manifest",
]
diff --git a/core/fpdfapi/font/BUILD.gn b/core/fpdfapi/font/BUILD.gn
index c5ce882..1e8c76e 100644
--- a/core/fpdfapi/font/BUILD.gn
+++ b/core/fpdfapi/font/BUILD.gn
@@ -48,9 +48,6 @@
"../cmaps",
"../parser",
]
- if (is_mac) {
- libs = [ "CoreFoundation.framework" ]
- }
allow_circular_includes_from = [
"../../fxge",
"../cmaps",
diff --git a/core/fxcrt/BUILD.gn b/core/fxcrt/BUILD.gn
index fd21666..88337ff 100644
--- a/core/fxcrt/BUILD.gn
+++ b/core/fxcrt/BUILD.gn
@@ -88,7 +88,6 @@
"../../fpdfsdk/*",
"../../fxbarcode:*",
"../../fxjs:*",
- "../../testing/fuzzers:*",
"../../third_party:fx_agg",
"../../third_party:fx_lcms2",
"../../third_party:fx_tiff",
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 83374cc..6c9ed9a 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -168,7 +168,6 @@
"apple/fx_mac_imp.cpp",
"apple/fx_quartz_device.cpp",
]
- libs = [ "CoreGraphics.framework" ]
}
if (is_win) {
diff --git a/public/fpdfview.h b/public/fpdfview.h
index 601ac54..8892da5 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
@@ -154,27 +154,12 @@
// Dictionary value types.
typedef int FPDF_OBJECT_TYPE;
-#if defined(COMPONENT_BUILD)
-#if defined(WIN32)
-#if defined(FPDF_IMPLEMENTATION)
+#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
+// On Windows system, functions are exported in a DLL
#define FPDF_EXPORT __declspec(dllexport)
-#else
-#define FPDF_EXPORT __declspec(dllimport)
-#endif // defined(FPDF_IMPLEMENTATION)
-#else
-#if defined(FPDF_IMPLEMENTATION)
-#define FPDF_EXPORT __attribute__((visibility("default")))
-#else
-#define FPDF_EXPORT
-#endif // defined(FPDF_IMPLEMENTATION)
-#endif // defined(WIN32)
-#else
-#define FPDF_EXPORT
-#endif // defined(COMPONENT_BUILD)
-
-#if defined(WIN32) && defined(FPDFSDK_EXPORTS)
#define FPDF_CALLCONV __stdcall
#else
+#define FPDF_EXPORT
#define FPDF_CALLCONV
#endif
diff --git a/testing/fuzzers/BUILD.gn b/testing/fuzzers/BUILD.gn
index fd47b88..0dbbccc 100644
--- a/testing/fuzzers/BUILD.gn
+++ b/testing/fuzzers/BUILD.gn
@@ -135,7 +135,6 @@
"pdf_cjs_util_fuzzer.cc",
]
deps = [
- "../../fpdfsdk",
"../../fxjs",
]
}
@@ -144,7 +143,6 @@
"pdf_fx_date_helpers_fuzzer.cc",
]
deps = [
- "../../fpdfsdk",
"../../fxjs",
]
}
@@ -155,7 +153,6 @@
"pdf_bidi_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fxge",
"../../xfa/fgas",
"../../xfa/fgas/layout",
@@ -167,7 +164,6 @@
"pdf_cfgas_stringformatter_fuzzer.cc",
]
deps = [
- "../../fpdfsdk",
"../../xfa/fgas",
"../../xfa/fxfa/parser",
]
@@ -178,7 +174,6 @@
"pdf_cfx_barcode_fuzzer.cc",
]
deps = [
- "../../fpdfsdk",
"../../xfa/fwl",
]
}
@@ -265,7 +260,6 @@
"pdf_css_fuzzer.cc",
]
deps = [
- "../../core/fxcodec",
"../../core/fxcrt/css",
]
}
@@ -275,7 +269,6 @@
"pdf_fm2js_fuzzer.cc",
]
deps = [
- "../../fpdfsdk",
"../../fxjs",
]
}
@@ -285,7 +278,6 @@
"pdf_formcalc_context_fuzzer.cc",
]
deps = [
- "../../fpdfsdk",
"../../fpdfsdk/fpdfxfa",
"../../fxjs",
"../../xfa/fxfa",
@@ -314,7 +306,6 @@
"pdf_cmap_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fpdfapi/font",
]
}
@@ -324,7 +315,6 @@
"pdf_codec_a85_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fxcodec",
]
}
@@ -335,7 +325,6 @@
]
deps = [
":utils",
- "../../core/fpdfapi",
"../../core/fxcodec",
]
}
@@ -345,7 +334,6 @@
"pdf_codec_icc_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fxcodec",
"../../third_party/:lcms2",
]
@@ -357,7 +345,6 @@
]
deps = [
":utils",
- "../../core/fpdfapi",
"../../core/fpdfapi/parser",
"../../core/fxcodec",
"../../core/fxge",
@@ -369,7 +356,6 @@
"pdf_codec_rle_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fxcodec",
]
}
@@ -385,7 +371,6 @@
"pdf_hint_table_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fpdfapi/parser",
]
}
@@ -395,7 +380,6 @@
"pdf_jpx_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fxcodec",
"../../core/fxge",
]
@@ -406,7 +390,6 @@
"pdf_psengine_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fpdfapi/page",
]
}
@@ -416,7 +399,6 @@
"pdf_streamparser_fuzzer.cc",
]
deps = [
- "../../core/fpdfapi",
"../../core/fpdfapi/page",
"../../core/fpdfapi/parser",
]
@@ -426,9 +408,6 @@
sources = [
"pdf_xml_fuzzer.cc",
]
- deps = [
- "../../core/fxcrt",
- ]
}
pdfium_public_fuzzer("pdfium_fuzzer_src") {