[Libreoffice-commits] core.git: external/pdfium

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 17:45:26 UTC 2020


 external/pdfium/UnpackedTarball_pdfium.mk  |    4 ++++
 external/pdfium/gcc-c++20-comparison.patch |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+)

New commits:
commit 6391e3c4dcd4d61c2f95f996e797e49b5586dbd1
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Sep 9 18:02:50 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Sep 9 19:44:46 2020 +0200

    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 at redhat.com>

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
+ 


More information about the Libreoffice-commits mailing list