[Libreoffice-commits] core.git: compilerplugins/clang include/unotools unotools/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 13 18:07:28 UTC 2021


 compilerplugins/clang/unnecessaryoverride.cxx |    2 ++
 include/unotools/streamhelper.hxx             |    3 +++
 unotools/source/streaming/streamhelper.cxx    |    5 +++++
 3 files changed, 10 insertions(+)

New commits:
commit c820cb429fc3d3eec9bf6596f0a34995cbd93982
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Aug 13 12:28:14 2021 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Aug 13 20:06:47 2021 +0200

    Help older linkers (Ubuntu 18.04, Fedora 31)
    
    Fixes a regression from commit 429e6e6efbfbc65d36452cbf8b3a25740a1dc8bc
    ("osl::Mutex->std::mutex in OInputStreamHelper"), which results in
    failed linking with some older toolchains:
    
    /usr/bin/ld.gold: error: workdir/CxxObject/xmlsecurity/source/helper/UriBindingHelper.o:
      requires dynamic R_X86_64_PC32 reloc against '_ZThn40_N3utl18OInputStreamHelper7acquireEv'
      which may overflow at runtime; recompile with -fPIC
    include/com/sun/star/uno/Reference.hxx:240: error: undefined reference to
      'non-virtual thunk to utl::OInputStreamHelper::acquire()'
    collect2: error: ld returned 1 exit status
    xmlsecurity/Library_xmlsecurity.mk:10: recipe for target
      'symbols/instdir/program/libxmlsecurity.so' failed
    
    Known problematic setups are my Ubuntu 18.04 build schroot and
    Caolán's Fedora 31 VM to run Coverity.
    
    Change-Id: I40f0734a0cb9131193abf21ba95dc63816b5c1d8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120426
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx
index 10ab158b7d8d..5013894aa398 100644
--- a/compilerplugins/clang/unnecessaryoverride.cxx
+++ b/compilerplugins/clang/unnecessaryoverride.cxx
@@ -95,6 +95,8 @@ public:
         // HAVE_ODBC_ADMINISTRATION
         if (loplugin::isSamePathname(fn, SRCDIR "/dbaccess/source/ui/dlg/dsselect.cxx"))
             return false;
+        if (loplugin::isSamePathname(fn, SRCDIR "/unotools/source/streaming/streamhelper.cxx"))
+            return false;
         return true;
     }
 
diff --git a/include/unotools/streamhelper.hxx b/include/unotools/streamhelper.hxx
index 26c7aa37c2da..5d0a3792855b 100644
--- a/include/unotools/streamhelper.hxx
+++ b/include/unotools/streamhelper.hxx
@@ -57,6 +57,9 @@ public:
     virtual void SAL_CALL seek( sal_Int64 location ) override;
     virtual sal_Int64 SAL_CALL getPosition(  ) override;
     virtual sal_Int64 SAL_CALL getLength(  ) override;
+
+    // workaround for Ubuntu 18.04 / Fedora 31 (Coverity VM) build with std::mutex; must not be inline!
+    virtual void SAL_CALL acquire() SAL_NOEXCEPT override;
 };
 
 }   // namespace utl
diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx
index 63820352179d..b5f07e6a6a7f 100644
--- a/unotools/source/streaming/streamhelper.cxx
+++ b/unotools/source/streaming/streamhelper.cxx
@@ -113,6 +113,11 @@ void SAL_CALL OInputStreamHelper::closeInput()
     m_xLockBytes = nullptr;
 }
 
+void SAL_CALL OInputStreamHelper::acquire() SAL_NOEXCEPT
+{
+    cppu::WeakImplHelper<css::io::XInputStream, css::io::XSeekable>::acquire();
+}
+
 } // namespace utl
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list