Unblock roll of PDFium into chromium
Remove GN arg which was conflicting.
Change-Id: I5e4851eeb8696818c63772905dd95ce1641a5374
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/107270
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 5889ff2..62a57c9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -222,42 +222,34 @@
# May flag some issues when converting int to size_t.
cflags += [ "-Wtautological-unsigned-zero-compare" ]
- # Catch misuse of cppgc in XFA.
- if (pdf_enable_xfa && clang_use_chrome_plugins) {
+ if (clang_use_chrome_plugins) {
+ # Catch misuse of C-style pointers.
cflags += [
- "-Xclang",
- "-add-plugin",
- "-Xclang",
- "blink-gc-plugin",
- ]
- }
+ # TODO(tsepez): enable these tests.
+ #"-Xclang",
+ #"-plugin-arg-find-bad-constructs",
+ #"-Xclang",
+ #"check-raw-ptr-fields",
- if (pdf_enable_unowned_ptr_exclusion) {
- cflags += [
- "-Xclang",
- "-plugin-arg-find-bad-constructs",
- "-Xclang",
- "check-raw-ptr-fields",
+ #"-Xclang",
+ #"-plugin-arg-find-bad-constructs",
+ #"-Xclang",
+ #"raw-ptr-exclude-path=public",
- "-Xclang",
- "-plugin-arg-find-bad-constructs",
- "-Xclang",
- "raw-ptr-exclude-path=public/",
+ #"-Xclang",
+ #"-plugin-arg-find-bad-constructs",
+ #"-Xclang",
+ #"raw-ptr-exclude-path=testing",
- "-Xclang",
- "-plugin-arg-find-bad-constructs",
- "-Xclang",
- "raw-ptr-exclude-path=testing/",
+ #"-Xclang",
+ #"-plugin-arg-find-bad-constructs",
+ #"-Xclang",
+ #"raw-ptr-exclude-path=unittest",
- "-Xclang",
- "-plugin-arg-find-bad-constructs",
- "-Xclang",
- "raw-ptr-exclude-path=unittest",
-
- "-Xclang",
- "-plugin-arg-find-bad-constructs",
- "-Xclang",
- "raw-ptr-exclude-path=embeddertest",
+ #"-Xclang",
+ #"-plugin-arg-find-bad-constructs",
+ #"-Xclang",
+ #"raw-ptr-exclude-path=embeddertest",
# TODO(tsepez): enforce raw_ref<> as well.
# "-Xclang",
@@ -265,7 +257,19 @@
# "-Xclang",
# "check-raw-ref-fields",
]
- defines += [ "PDF_ENABLE_UNOWNED_PTR_EXCLUSION" ]
+ defines += [
+ #"PDF_ENABLE_UNOWNED_PTR_EXCLUSION",
+ ]
+
+ # Catch misuse of cppgc in XFA.
+ if (pdf_enable_xfa) {
+ cflags += [
+ "-Xclang",
+ "-add-plugin",
+ "-Xclang",
+ "blink-gc-plugin",
+ ]
+ }
}
}
diff --git a/README.md b/README.md
index 657cfda..cf09278 100644
--- a/README.md
+++ b/README.md
@@ -95,6 +95,11 @@
By default, the entire project builds with C++17.
+By default, PDFium expects to build with a clang compiler that provides
+additional chrome plugins. To build against a vanilla one lacking these,
+one must set
+`clang_use_chrome_plugins = false`.
+
When complete the arguments will be stored in `<directory>/args.gn`, and
GN will automatically use the new arguments to generate build files.
Should your files fail to generate, please double-check that you have set
diff --git a/build_overrides/pdfium.gni b/build_overrides/pdfium.gni
index 134dd01..b7dc9e0 100644
--- a/build_overrides/pdfium.gni
+++ b/build_overrides/pdfium.gni
@@ -9,10 +9,6 @@
# Default: Use a bundled FreeType.
pdf_bundle_freetype_override = true
-# Build PDFium with Chromium's raw_ptr restriction enforcing clang plugin.
-# Default: Do not enforce this restriction
-pdf_enable_unowned_ptr_exclusion_override = false
-
# Build PDFium either with or without v8 support.
# Default: With V8 support.
pdf_enable_v8_override = true
diff --git a/pdfium.gni b/pdfium.gni
index f451397..9c6ae8d 100644
--- a/pdfium.gni
+++ b/pdfium.gni
@@ -18,9 +18,6 @@
# Generate logging messages for click events that reach PDFium
pdf_enable_click_logging = false
- # Enforce chrome plugin raw_ptr restrictions.
- pdf_enable_unowned_ptr_exclusion = pdf_enable_unowned_ptr_exclusion_override
-
# Build PDFium either with or without v8 support.
pdf_enable_v8 = pdf_enable_v8_override