summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-09-09 18:02:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-09-09 19:44:46 +0200
commit6391e3c4dcd4d61c2f95f996e797e49b5586dbd1 (patch)
tree6dad0dceb39b0e5a515ef6bfaefb366c725c3f09 /external
parente7b0e0b2b0df7197ee04c5c7232145d7a044bae0 (diff)
external/pdfium: Work around GCC C++20 recursive comparison issue
...that caused CppunitTest_xmlsecurity_pdfsigning to crash with recent GCC and --with-latest-c++ due to an infinite recursion at [...] > #260048 0x00007fe0dbf91a4f in fxcrt::operator==<CPDF_Array const, CPDF_Object>(CPDF_Object const*, fxcrt::RetainPtr<CPDF_Array const> const&) (lhs=0x2342870, rhs=...) at workdir/UnpackedTarball/pdfium/core/fxcrt/retain_ptr.h:140 > #260049 0x00007fe0dbf91a4f in fxcrt::operator==<CPDF_Array const, CPDF_Object>(CPDF_Object const*, fxcrt::RetainPtr<CPDF_Array const> const&) (lhs=0x2342870, rhs=...) at workdir/UnpackedTarball/pdfium/core/fxcrt/retain_ptr.h:140 > #260050 0x00007fe0dbf8e30d in (anonymous namespace)::CPDF_DeviceNCS::v_Load(CPDF_Document*, CPDF_Array const*, std::__debug::set<CPDF_Object const*, std::less<CPDF_Object const*>, std::allocator<CPDF_Object const*> >*) (this=0x1956e30, pDoc=0x172a770, pArray=0x2343320, pVisited=0x7ffcf2f2dd50) at workdir/UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_colorspace.cpp:1299 > #260051 0x00007fe0dbf8a73f in CPDF_ColorSpace::Load(CPDF_Document*, CPDF_Object const*, std::__debug::set<CPDF_Object const*, std::less<CPDF_Object const*>, std::allocator<CPDF_Object const*> >*) (pDoc=0x172a770, pObj=0x2343320, pVisited=0x7ffcf2f2dd50) at workdir/UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_colorspace.cpp:545 > #260052 0x00007fe0dbfa4c01 in CPDF_DocPageData::GetColorSpaceInternal(CPDF_Object const*, CPDF_Dictionary const*, std::__debug::set<CPDF_Object const*, std::less<CPDF_Object const*>, std::allocator<CPDF_Object const*> >*, std::__debug::set<CPDF_Object const*, std::less<CPDF_Object const*>, std::allocator<CPDF_Object const*> >*) (this=0x1737a70, pCSObj=0x2343320, pResources=0x0, pVisited=0x7ffcf2f2dd50, pVisitedInternal=0x7ffcf2f2dcc0) at workdir/UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_docpagedata.cpp:317 [...] (See the linked GCC bug report for further details.) Change-Id: I8cc1ff0b6e5693b987e6c6c9b2efed7990d0869f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102330 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/pdfium/UnpackedTarball_pdfium.mk4
-rw-r--r--external/pdfium/gcc-c++20-comparison.patch18
2 files changed, 22 insertions, 0 deletions
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index f4643376cee0..43c17aa3dd97 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,6 +14,10 @@ pdfium_patches += build.patch.1
# Avoids Windows 8 build dependency.
pdfium_patches += windows7.patch.1
pdfium_patches += c++20-comparison.patch
+# Work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94141> "c++20 rewritten operator==
+# recursive call mixing friend and external operators for template class" in GCC with
+# --with-latest-c++:
+pdfium_patches += gcc-c++20-comparison.patch
$(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
diff --git a/external/pdfium/gcc-c++20-comparison.patch b/external/pdfium/gcc-c++20-comparison.patch
new file mode 100644
index 000000000000..e81cb4fe2aa7
--- /dev/null
+++ b/external/pdfium/gcc-c++20-comparison.patch
@@ -0,0 +1,18 @@
+--- core/fxcrt/retain_ptr.h
++++ core/fxcrt/retain_ptr.h
+@@ -135,6 +135,7 @@
+ mutable intptr_t m_nRefCount = 0;
+ };
+
++#if !(defined __GNUC__ && !defined __clang__ && __cplusplus > 201703L)
+ template <typename T, typename U>
+ inline bool operator==(const U* lhs, const RetainPtr<T>& rhs) {
+ return rhs == lhs;
+@@ -144,6 +144,7 @@
+ inline bool operator!=(const U* lhs, const RetainPtr<T>& rhs) {
+ return rhs != lhs;
+ }
++#endif
+
+ } // namespace fxcrt
+