summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
Diffstat (limited to 'external')
-rw-r--r--external/pdfium/Library_pdfium.mk74
-rw-r--r--external/pdfium/README1
-rw-r--r--external/pdfium/UnpackedTarball_pdfium.mk7
-rw-r--r--external/pdfium/freetype.patch.118
-rw-r--r--external/pdfium/system-zlib.patch.12
-rw-r--r--external/pdfium/ubsan.patch6
6 files changed, 77 insertions, 31 deletions
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index e8f2a9e9b481..9695552aaa8e 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -15,12 +15,14 @@ $(eval $(call gb_Library_set_warnings_not_errors,pdfium))
$(eval $(call gb_Library_set_include,pdfium,\
-I$(WORKDIR)/UnpackedTarball/pdfium \
+ -I$(WORKDIR)/UnpackedTarball/pdfium/third_party \
$$(INCLUDE) \
))
$(eval $(call gb_Library_add_defs,pdfium,\
-DPDFIUM_DLLIMPLEMENTATION \
-DUSE_SYSTEM_LIBJPEG \
+ -DUNICODE \
))
# Don't show warnings upstream doesn't care about.
@@ -324,24 +326,26 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
# fxcrt
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/core/fxcrt/fx_basic_array \
- UnpackedTarball/pdfium/core/fxcrt/fx_basic_bstring \
+ UnpackedTarball/pdfium/core/fxcrt/cfx_blockbuffer \
+ UnpackedTarball/pdfium/core/fxcrt/cfx_bytestring \
+ UnpackedTarball/pdfium/core/fxcrt/cfx_widestring \
UnpackedTarball/pdfium/core/fxcrt/fx_basic_buffer \
UnpackedTarball/pdfium/core/fxcrt/fx_basic_coords \
UnpackedTarball/pdfium/core/fxcrt/fx_basic_gcc \
UnpackedTarball/pdfium/core/fxcrt/fx_basic_memmgr \
UnpackedTarball/pdfium/core/fxcrt/fx_basic_utf \
UnpackedTarball/pdfium/core/fxcrt/fx_basic_util \
- UnpackedTarball/pdfium/core/fxcrt/fx_basic_wstring \
UnpackedTarball/pdfium/core/fxcrt/fx_bidi \
UnpackedTarball/pdfium/core/fxcrt/fx_extension \
UnpackedTarball/pdfium/core/fxcrt/fx_ucddata \
UnpackedTarball/pdfium/core/fxcrt/fx_unicode \
- UnpackedTarball/pdfium/core/fxcrt/fx_xml_composer \
- UnpackedTarball/pdfium/core/fxcrt/fx_xml_parser \
UnpackedTarball/pdfium/core/fxcrt/fxcrt_posix \
UnpackedTarball/pdfium/core/fxcrt/fxcrt_stream \
UnpackedTarball/pdfium/core/fxcrt/fxcrt_windows \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cxml_attritem \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cxml_attrmap \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cxml_element \
+ UnpackedTarball/pdfium/core/fxcrt/xml/cxml_parser \
))
# fxedit
@@ -353,11 +357,18 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
# fxge
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/core/fxge/dib/fx_dib_composite \
- UnpackedTarball/pdfium/core/fxge/dib/fx_dib_convert \
- UnpackedTarball/pdfium/core/fxge/dib/fx_dib_engine \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_bitmapcomposer \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_bitmapstorer \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_dibextractor \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_dibitmap \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_dibsource \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_filtereddib \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_imagerenderer \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_imagestretcher \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_imagetransformer \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_scanlinecompositor \
+ UnpackedTarball/pdfium/core/fxge/dib/cstretchengine \
UnpackedTarball/pdfium/core/fxge/dib/fx_dib_main \
- UnpackedTarball/pdfium/core/fxge/dib/fx_dib_transform \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitDingbats \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixed \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBold \
@@ -488,6 +499,14 @@ $(eval $(call gb_Library_add_generated_cobjects,pdfium,\
UnpackedTarball/pdfium/third_party/libopenjpeg20/tgt \
))
+# pdfium_base
+$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/page_allocator \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/spin_lock \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_alloc \
+))
+
$(eval $(call gb_Library_use_externals,pdfium,\
jpeg \
zlib \
@@ -504,32 +523,35 @@ $(eval $(call gb_Library_use_external,pdfium,freetype))
else
$(eval $(call gb_Library_set_include,pdfium,\
-I$(WORKDIR)/UnpackedTarball/pdfium/third_party/freetype/include/ \
+ -I$(WORKDIR)/UnpackedTarball/pdfium/third_party/freetype/src/include/ \
$$(INCLUDE) \
))
$(eval $(call gb_Library_add_defs,pdfium,\
-DFT2_BUILD_LIBRARY \
+ -DFT_CONFIG_MODULES_H='<freetype-custom-config/ftmodule.h>' \
+ -DFT_CONFIG_OPTIONS_H='<freetype-custom-config/ftoption.h>' \
))
# third_party/freetype
$(eval $(call gb_Library_add_generated_cobjects,pdfium,\
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftbase \
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftbitmap \
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftglyph \
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftinit \
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftlcdfil \
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftmm \
- UnpackedTarball/pdfium/third_party/freetype/src/base/ftsystem \
- UnpackedTarball/pdfium/third_party/freetype/src/cff/cff \
- UnpackedTarball/pdfium/third_party/freetype/src/cid/type1cid \
- UnpackedTarball/pdfium/third_party/freetype/src/psaux/psaux \
- UnpackedTarball/pdfium/third_party/freetype/src/pshinter/pshinter \
- UnpackedTarball/pdfium/third_party/freetype/src/psnames/psmodule \
- UnpackedTarball/pdfium/third_party/freetype/src/raster/raster \
- UnpackedTarball/pdfium/third_party/freetype/src/sfnt/sfnt \
- UnpackedTarball/pdfium/third_party/freetype/src/smooth/smooth \
- UnpackedTarball/pdfium/third_party/freetype/src/truetype/truetype \
- UnpackedTarball/pdfium/third_party/freetype/src/type1/type1 \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftbase \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftbitmap \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftglyph \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftinit \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftlcdfil \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftmm \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/base/ftsystem \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/cff/cff \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/cid/type1cid \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/psaux/psaux \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/pshinter/pshinter \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/psnames/psmodule \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/raster/raster \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/sfnt/sfnt \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/smooth/smooth \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/truetype/truetype \
+ UnpackedTarball/pdfium/third_party/freetype/src/src/type1/type1 \
))
endif
diff --git a/external/pdfium/README b/external/pdfium/README
index 8c8cbc5622ba..c1719cf0a152 100644
--- a/external/pdfium/README
+++ b/external/pdfium/README
@@ -9,4 +9,5 @@ How to update the tarball:
version=$(git for-each-ref|grep chromium/|tail -n 1|sed 's|.*/||')
git archive --prefix=pdfium/ --format=tar origin/chromium/${version} > pdfium-${version}.tar
+(cd ..; tar --append --file pdfium/pdfium-${version}.tar pdfium/third_party/freetype/src/include/ pdfium/third_party/freetype/src/src/)
bzip2 pdfium-${version}.tar
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index 730181d2c1f3..ee9a417db1c5 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,6 +14,7 @@ pdfium_patches += macos.patch.1
pdfium_patches += ubsan.patch
# Upstreamed as <https://pdfium-review.googlesource.com/4070>.
pdfium_patches += system-zlib.patch.1
+pdfium_patches += freetype.patch.1
$(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
@@ -29,7 +30,11 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
mv third_party/bigint/BigInteger.cc third_party/bigint/BigInteger.cpp && \
mv third_party/bigint/BigIntegerUtils.cc third_party/bigint/BigIntegerUtils.cpp && \
mv third_party/bigint/BigUnsigned.cc third_party/bigint/BigUnsigned.cpp && \
- mv third_party/bigint/BigUnsignedInABase.cc third_party/bigint/BigUnsignedInABase.cpp \
+ mv third_party/bigint/BigUnsignedInABase.cc third_party/bigint/BigUnsignedInABase.cpp && \
+ mv third_party/base/allocator/partition_allocator/address_space_randomization.cc third_party/base/allocator/partition_allocator/address_space_randomization.cpp && \
+ mv third_party/base/allocator/partition_allocator/page_allocator.cc third_party/base/allocator/partition_allocator/page_allocator.cpp && \
+ mv third_party/base/allocator/partition_allocator/partition_alloc.cc third_party/base/allocator/partition_allocator/partition_alloc.cpp && \
+ mv third_party/base/allocator/partition_allocator/spin_lock.cc third_party/base/allocator/partition_allocator/spin_lock.cpp \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/freetype.patch.1 b/external/pdfium/freetype.patch.1
new file mode 100644
index 000000000000..90f230c54e69
--- /dev/null
+++ b/external/pdfium/freetype.patch.1
@@ -0,0 +1,18 @@
+Upstream provides this define from the commandline, but while this define is
+needed for fxge, it breaks the build for the bundled freetype. gbuild doesn't
+support having different defines within the same Library, so just patch the
+single translation unit that actually needs the define.
+
+Long-term perhaps the solution is to enable freetype on all platforms inside
+LO, then we don't have to build freetype as part of pdfium, so we can let
+gbuild define this from the commandline.
+
+diff --git a/core/fxge/freetype/fx_freetype.cpp b/core/fxge/freetype/fx_freetype.cpp
+index 0ae207b02..879bf5ab9 100644
+--- a/core/fxge/freetype/fx_freetype.cpp
++++ b/core/fxge/freetype/fx_freetype.cpp
+@@ -1,3 +1,4 @@
++#define DEFINE_PS_TABLES
+ // Copyright 2014 PDFium Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
diff --git a/external/pdfium/system-zlib.patch.1 b/external/pdfium/system-zlib.patch.1
index 9197fd2bab90..cbac836ea02e 100644
--- a/external/pdfium/system-zlib.patch.1
+++ b/external/pdfium/system-zlib.patch.1
@@ -6,7 +6,7 @@ index c73703f..ea601af 100644
#include "core/fxcrt/fx_ext.h"
#include "third_party/base/numerics/safe_conversions.h"
#include "third_party/base/ptr_util.h"
--#include "third_party/zlib_v128/zlib.h"
+-#include "third_party/zlib/zlib.h"
+#include "zlib.h"
extern "C" {
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
index 27ec578ca321..4349e860bd37 100644
--- a/external/pdfium/ubsan.patch
+++ b/external/pdfium/ubsan.patch
@@ -1,12 +1,12 @@
--- core/fxge/ge/cfx_facecache.cpp
+++ core/fxge/ge/cfx_facecache.cpp
-@@ -205,7 +205,8 @@
+@@ -206,7 +206,8 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(const CFX_Font* pFont,
}
}
} else {
-- FXSYS_memset(pDestBuf, 0, dest_pitch * bmheight);
+- memset(pDestBuf, 0, dest_pitch * bmheight);
+ if (dest_pitch != 0 && bmheight != 0)
-+ FXSYS_memset(pDestBuf, 0, dest_pitch * bmheight);
++ memset(pDestBuf, 0, dest_pitch * bmheight);
if (anti_alias == FXFT_RENDER_MODE_MONO &&
FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) ==
FXFT_PIXEL_MODE_MONO) {