summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
Diffstat (limited to 'external')
-rw-r--r--external/pdfium/Library_pdfium.mk2
-rw-r--r--external/pdfium/UnpackedTarball_pdfium.mk5
-rw-r--r--external/pdfium/build.patch.113
-rw-r--r--external/pdfium/visibility.patch.131
-rw-r--r--external/pdfium/windows7.patch.134
5 files changed, 62 insertions, 23 deletions
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index 2bfa8210676d..17417ac5b86e 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -200,7 +200,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pagemodule \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobject \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobjectholder \
- UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobjectlist \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_path \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pathobject \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pattern \
@@ -630,6 +629,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/win32/fx_win32_gdipext \
UnpackedTarball/pdfium/core/fxge/win32/fx_win32_print \
UnpackedTarball/pdfium/core/fxcrt/cfx_fileaccess_windows \
+ UnpackedTarball/pdfium/third_party/base/win/win_util \
))
$(eval $(call gb_Library_use_system_win32_libs,pdfium,\
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index eda4fd781e8d..8f493ea3a0d6 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -12,6 +12,8 @@ pdfium_patches += visibility.patch.1
pdfium_patches += ubsan.patch
# Fixes build on our baseline.
pdfium_patches += build.patch.1
+# Avoids Windows 8 build dependency.
+pdfium_patches += windows7.patch.1
$(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
@@ -41,7 +43,8 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
mv third_party/base/allocator/partition_allocator/partition_bucket.cc third_party/base/allocator/partition_allocator/partition_bucket.cpp && \
mv third_party/base/allocator/partition_allocator/partition_oom.cc third_party/base/allocator/partition_allocator/partition_oom.cpp && \
mv third_party/base/allocator/partition_allocator/partition_page.cc third_party/base/allocator/partition_allocator/partition_page.cpp && \
- mv third_party/base/allocator/partition_allocator/partition_root_base.cc third_party/base/allocator/partition_allocator/partition_root_base.cpp \
+ mv third_party/base/allocator/partition_allocator/partition_root_base.cc third_party/base/allocator/partition_allocator/partition_root_base.cpp && \
+ mv third_party/base/win/win_util.cc third_party/base/win/win_util.cpp \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index a1ec25e8b223..562b2e6198d3 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -71,16 +71,3 @@ index 7f4eb86c0..5e227f86e 100644
};
#endif // CORE_FPDFDOC_CPDF_DEST_H_
-diff --git a/core/fpdfdoc/cpdf_filespec.h b/core/fpdfdoc/cpdf_filespec.h
-index 7050f695b..916afed8b 100644
---- a/core/fpdfdoc/cpdf_filespec.h
-+++ b/core/fpdfdoc/cpdf_filespec.h
-@@ -41,7 +41,7 @@ class CPDF_FileSpec {
-
- private:
- UnownedPtr<const CPDF_Object> const m_pObj;
-- UnownedPtr<CPDF_Object> const m_pWritableObj;
-+ UnownedPtr<CPDF_Object> m_pWritableObj;
- };
-
- #endif // CORE_FPDFDOC_CPDF_FILESPEC_H_
diff --git a/external/pdfium/visibility.patch.1 b/external/pdfium/visibility.patch.1
index 04e89b38ab10..9983723b2055 100644
--- a/external/pdfium/visibility.patch.1
+++ b/external/pdfium/visibility.patch.1
@@ -1,26 +1,41 @@
diff --git a/public/fpdfview.h b/public/fpdfview.h
-index 1ff0aeb26..f48036f2b 100644
+index f5212599f..57d6cda13 100644
--- a/public/fpdfview.h
+++ b/public/fpdfview.h
-@@ -129,14 +129,20 @@ typedef int FPDF_ANNOTATION_SUBTYPE;
+@@ -154,31 +154,20 @@ typedef int FPDF_ANNOT_APPEARANCEMODE;
// Dictionary value types.
typedef int FPDF_OBJECT_TYPE;
--#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
--// On Windows system, functions are exported in a DLL
+-#if defined(COMPONENT_BUILD)
+-// FPDF_EXPORT should be consistent with |export| in the pdfium_fuzzer
+-// template in testing/fuzzers/BUILD.gn.
+-#if defined(WIN32)
+-#if defined(FPDF_IMPLEMENTATION)
+#if defined(PDFIUM_DLLIMPLEMENTATION)
+#ifdef _WIN32
#define FPDF_EXPORT __declspec(dllexport)
--#define FPDF_CALLCONV __stdcall
#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
--#define FPDF_CALLCONV
+-#endif // defined(FPDF_IMPLEMENTATION)
+-#endif // defined(WIN32)
+#define FPDF_EXPORT __attribute__ ((visibility("default")))
+#endif
-+#else
+ #else
+-#define FPDF_EXPORT
+-#endif // defined(COMPONENT_BUILD)
+-
+-#if defined(WIN32) && defined(FPDFSDK_EXPORTS)
+-#define FPDF_CALLCONV __stdcall
+#ifdef _WIN32
+#define FPDF_EXPORT __declspec(dllimport)
-+#else
+ #else
+-#define FPDF_CALLCONV
+#define FPDF_EXPORT __attribute__ ((visibility("default")))
#endif
+#endif
diff --git a/external/pdfium/windows7.patch.1 b/external/pdfium/windows7.patch.1
new file mode 100644
index 000000000000..5b793136f023
--- /dev/null
+++ b/external/pdfium/windows7.patch.1
@@ -0,0 +1,34 @@
+diff --git a/third_party/base/win/win_util.cc b/third_party/base/win/win_util.cc
+index 9c90b9d62..356eca74d 100644
+--- a/third_party/base/win/win_util.cc
++++ b/third_party/base/win/win_util.cc
+@@ -12,28 +12,7 @@ namespace base {
+ namespace win {
+
+ bool IsUser32AndGdi32Available() {
+- static auto is_user32_and_gdi32_available = []() {
+- // If win32k syscalls aren't disabled, then user32 and gdi32 are available.
+-
+- typedef decltype(
+- GetProcessMitigationPolicy)* GetProcessMitigationPolicyType;
+- GetProcessMitigationPolicyType get_process_mitigation_policy_func =
+- reinterpret_cast<GetProcessMitigationPolicyType>(GetProcAddress(
+- GetModuleHandle(L"kernel32.dll"), "GetProcessMitigationPolicy"));
+-
+- if (!get_process_mitigation_policy_func)
+- return true;
+-
+- PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY policy = {};
+- if (get_process_mitigation_policy_func(GetCurrentProcess(),
+- ProcessSystemCallDisablePolicy,
+- &policy, sizeof(policy))) {
+- return policy.DisallowWin32kSystemCalls == 0;
+- }
+-
+- return true;
+- }();
+- return is_user32_and_gdi32_available;
++ return true;
+ }
+
+ } // namespace win