[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - 9 commits - external/coinmp external/liborcus external/libwpd include/o3tl odk/build-examples_common.mk sfx2/source solenv/gbuild

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri May 14 12:59:44 UTC 2021


 external/coinmp/UnpackedTarball_coinmp.mk     |    2 
 external/coinmp/configure-exit.patch          |   33 ++
 external/coinmp/register.patch                |  369 ++++++++++++++++++++++++++
 external/liborcus/UnpackedTarball_liborcus.mk |    1 
 external/liborcus/include.patch.0             |   30 ++
 external/libwpd/UnpackedTarball_libwpd.mk     |    1 
 external/libwpd/include.patch                 |   10 
 include/o3tl/lru_map.hxx                      |    2 
 odk/build-examples_common.mk                  |    2 
 sfx2/source/doc/objstor.cxx                   |   33 ++
 solenv/gbuild/platform/com_GCC_defs.mk        |    4 
 11 files changed, 486 insertions(+), 1 deletion(-)

New commits:
commit 2976392800739d38d5f84f1f8242701c526b29e1
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Jul 10 14:30:34 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:54:45 2021 +0200

    tdf#134582 sfx2: when storing, set Version on embedded object storage
    
    This previously wasn't needed because there was only one version for
    which it was checked (1.2) but since commit
    a541cd91951eca15e40764244b34c72b347f9f26 there's a second version so
    when loading an existing embedded object in one version and storing it
    in another, the Version must be updated so the attribute in
    META-INF/manifest.xml matches the one in content.xml.
    
    Change-Id: Ic2fc303c6f6bc254050d531d578029377976ecb5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98521
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 519d96fd8b83ef4c61576d87b58f97b7e6e6e3c6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98459
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit a24a4cc1838e3a2d55261a8edf6cb63186f4c38f)

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 6d7b3f99ee69..ab3dee35e5c2 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -984,6 +984,39 @@ bool SfxObjectShell::DoSave()
 
         pImpl->bIsSaving = true;
 
+        if (IsOwnStorageFormat(*GetMedium()))
+        {
+            SvtSaveOptions::ODFSaneDefaultVersion nDefVersion = SvtSaveOptions::ODFSVER_012;
+            if (!utl::ConfigManager::IsFuzzing())
+            {
+                SvtSaveOptions aSaveOpt;
+                nDefVersion = aSaveOpt.GetODFSaneDefaultVersion();
+            }
+            uno::Reference<beans::XPropertySet> const xProps(GetMedium()->GetStorage(), uno::UNO_QUERY);
+            assert(xProps.is());
+            if (nDefVersion >= SvtSaveOptions::ODFSVER_012) // property exists only since ODF 1.2
+            {
+                try // tdf#134582 set Version on embedded objects as they
+                {   // could have been loaded with a different/old version
+#if 0
+// not on old branch
+                    if (SvtSaveOptions::ODFSVER_013 <= nDefVersion)
+                    {
+                        xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_013_TEXT));
+                    }
+                    else
+#endif
+                    {
+                        xProps->setPropertyValue("Version", uno::makeAny<OUString>(ODFVER_012_TEXT));
+                    }
+                }
+                catch (uno::Exception&)
+                {
+                    TOOLS_WARN_EXCEPTION("sfx.doc", "SfxObjectShell::DoSave");
+                }
+            }
+        }
+
         uno::Sequence< beans::NamedValue > aEncryptionData;
         if ( IsPackageStorageFormat_Impl( *GetMedium() ) )
         {
commit 2575182a0e106f61be4c5bd8a2ff60e069936424
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 12 15:50:10 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:54 2021 +0200

    Missing include (for std::min)
    
    Change-Id: I44eebee0149d7e890aeff715dd7ae0005c45378d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109179
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit e24cc814b5b6e50967116cb3908e4bf56b7aee4b)

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index 33a1487fa239..fac5f6b739ed 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -11,6 +11,7 @@
 #ifndef INCLUDED_O3TL_LRU_MAP_HXX
 #define INCLUDED_O3TL_LRU_MAP_HXX
 
+#include <algorithm>
 #include <cassert>
 #include <list>
 #include <unordered_map>
commit 8acc85c4f96313468147e8dff54255aa1c8be4ce
Author:     Jeff Law <law at redhat.com>
AuthorDate: Tue Nov 3 08:05:03 2020 -0700
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:53 2021 +0200

    include cstddef for gcc11
    
    Change-Id: I2f845ce9bb660ad6c1eea80ea81dd71add2c0db1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107191
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 8830cf86b146b1252ac37f351a23246088d569b0)

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index e822fde0294c..33a1487fa239 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -14,6 +14,7 @@
 #include <cassert>
 #include <list>
 #include <unordered_map>
+#include <cstddef>
 
 namespace o3tl
 {
commit dff559024d271a69186b608615f4a7095cbee2a4
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Mon May 3 12:48:14 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:53 2021 +0200

    odk: build examples with GCC with explicit -std=c++11
    
    GCC 11 defaults to -std=c++17, which doesn't support exception
    specifications any more.
    
    ddcc98fa50dd9d86a60dada4daa00f4d95ffe005 seems a bit large to backport.
    
    Change-Id: I74a182435b268be8fd7a9ff0be9f404122108b51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115505
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/odk/build-examples_common.mk b/odk/build-examples_common.mk
index 50ea40ec905e..f05220f3f635 100644
--- a/odk/build-examples_common.mk
+++ b/odk/build-examples_common.mk
@@ -48,7 +48,7 @@ endif
 	$(foreach my_dir,$(2), \
 	    && (cd $(INSTDIR)/$(SDKDIRNAME)/examples/$(my_dir) \
 		&& printf 'yes\n' | LC_ALL=C make \
-			CC="$(CXX)" LINK="$(CXX)" LIB="$(CXX)" \
+			CC="$(CXX) $(if $(filter GCC,$(COM)),-std=c++11)" LINK="$(CXX)" LIB="$(CXX)" \
 		    $(if $(MACOSX_SHELL_HACK), SHELL=$(ODK_BUILD_SHELL), )))) \
 	    >$(call gb_CustomTarget_get_workdir,$(1))/log 2>&1 \
 	|| (RET=$$$$? \
commit c2a882e896d9a1a2af3bc5652a2dd4a9b0e486ee
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Tue May 4 09:22:03 2021 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:53 2021 +0200

    gbuild: work around GDB 10 bug with DWARF5 in split debug info
    
    GCC 11 defaults to -gdwarf-5 and GDB can only read it if
    -gsplit-dwarf isn't used.
    
    Dwarf Error: wrong unit_type in compilation unit header (is DW_UT_split_compile (0x05), should be DW_UT_type (0x02)) [in module /workdir/CObject/desktop/source/app/main.dwo]
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=27354
    https://bugzilla.redhat.com/show_bug.cgi?id=1956475
    
    Change-Id: Ie2ac7193a29a8f257cf6f1d711f9fa6941df48ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115054
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit dc8c8a4aa20ddd3139a25d5c052cac9bae944cb8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115193
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 626ea4e62a3e5005fe9825923a1c0c5bdb61cc08)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115504
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 9e3b695360cd..c976652d6ecd 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -205,8 +205,12 @@ gb_DEBUGINFO_FLAGS=-g2
 endif
 gb_LINKER_DEBUGINFO_FLAGS=
 
+# GCC 11 defaults to -gdwarf-5, which GDB 10 doesn't support in split debug info
 ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE)
 gb_DEBUGINFO_FLAGS+=-gsplit-dwarf
+ifeq ($(COM_IS_CLANG),)
+gb_DEBUGINFO_FLAGS+=-gdwarf-4
+endif
 endif
 
 ifeq ($(ENABLE_GDB_INDEX),TRUE)
commit fdbc4995522167cc64b6b9ec3f9d523c75e52511
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Nov 5 08:16:43 2020 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:53 2021 +0200

    external/libwpd: Missing include for size_t
    
    ...as now reported when building with recent trunk GCC/libstdc++ on Linux:
    
    > In file included from WPXContentListener.cpp:26:
    > In file included from ./WPXContentListener.h:29:
    > ./WPXTable.h:56:31: error: unknown type name 'size_t'; did you mean 'std::size_t'?
    >         const WPXTableCell  *getCell(size_t i, size_t j)
    >                                      ^~~~~~
    >                                      std::size_t
    
    Change-Id: Ic20240f01c7b0305cb87ababf53a3aaf66072d61
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105324
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 8d378abf1de0a47517427c086da26588f846592a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115000
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 524cfb93d4033917ad20c718d538235078d068d5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115503
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/libwpd/UnpackedTarball_libwpd.mk b/external/libwpd/UnpackedTarball_libwpd.mk
index 8d0227b9379d..eefa9331c8d6 100644
--- a/external/libwpd/UnpackedTarball_libwpd.mk
+++ b/external/libwpd/UnpackedTarball_libwpd.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,libwpd))
 $(eval $(call gb_UnpackedTarball_add_patches,libwpd,\
 	external/libwpd/libwpd-vs2013.patch.1 \
 	$(if $(SYSTEM_REVENGE),,external/libwpd/rpath.patch) \
+	external/libwpd/include.patch \
 ))
 
 ifneq ($(OS),MACOSX)
diff --git a/external/libwpd/include.patch b/external/libwpd/include.patch
new file mode 100644
index 000000000000..57f52b4b0aa5
--- /dev/null
+++ b/external/libwpd/include.patch
@@ -0,0 +1,10 @@
+--- src/lib/WPXTable.h
++++ src/lib/WPXTable.h
+@@ -36,6 +36,7 @@
+ #ifndef _WPXTABLE_H
+ #define _WPXTABLE_H
+ 
++#include <stddef.h>
+ #include <vector>
+ 
+ struct WPXTableCell
commit 7035bb24dd2f925e709ca41241c52fa0aa2e854e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Oct 1 11:50:40 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:52 2021 +0200

    exteranl/coinmp: Fix build with recent GCC 11 trunk
    
    It had started to fail for me now with
    
    >  ~/gcc/trunk/inst/bin/g++ -DHAVE_CONFIG_H -I. -I. -O -MT CoinFinite.lo -MD -MP -MF .deps/CoinFinite.Tpo -c CoinFinite.cpp  -fPIC -DPIC -o .libs/CoinFinite.o
    > CoinFinite.cpp: In function 'bool CoinFinite(double)':
    > CoinFinite.cpp:38:19: error: 'DBL_MAX' was not declared in this scope
    >    38 |     return val != DBL_MAX && val != -DBL_MAX;
    >       |                   ^~~~~~~
    > CoinFinite.cpp:8:1: note: 'DBL_MAX' is defined in header '<cfloat>'; did you forget to '#include <cfloat>'?
    >     7 | #include "CoinUtilsConfig.h"
    >   +++ |+#include <cfloat>
    >     8 |
    
    because of a missing -DCOINUTILS_BUILD.  Which in turn was caused by
    workdir/UnpackedTarball/coinmp/CoinUtils/configure (see
    workdir/UnpackedTarball/coinmp/CoinUtils/config.log), which first tries to
    determine an ac_declaration that would apparently be a suitable declaration of
    `exit` without actually including <stdlib.h> in a C++ file.  It settles on
    
    > configure:3551: ~/gcc/trunk/inst/bin/g++ -c -g -O2  conftest.cc >&5
    > conftest.cc:15:17: warning: 'void std::exit(int)' has not been declared within 'std'
    >    15 | extern "C" void std::exit (int) throw (); using std::exit;
    >       |                 ^~~
    > <built-in>: note: only here as a 'friend'
    > configure:3557: $? = 0
    
    (which generates a warning, but no error with the given g++ invocation).  The
    determined ac_declaration value is then included in confdefs.h, causing the
    later
    
    > configure:4014: ~/gcc/trunk/inst/bin/g++ -o conftest -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long   -DCOINUTILS_BUILD  -Wl,-z,origin -Wl,-rpath,\$$ORIGIN conftest.cc  >&5
    > conftest.cc:15:17: error: 'void std::exit(int)' has not been declared within 'std'
    >    15 | extern "C" void std::exit (int) throw (); using std::exit;
    >       |                 ^~~
    > <built-in>: note: only here as a 'friend'
    > configure:4020: $? = 1
    > configure: failed program was:
    > | /* confdefs.h.  */
    > |
    > | #define PACKAGE_NAME "CoinUtils"
    > | #define PACKAGE_TARNAME "coinutils"
    > | #define PACKAGE_VERSION "2.9.11"
    > | #define PACKAGE_STRING "CoinUtils 2.9.11"
    > | #define PACKAGE_BUGREPORT "http://projects.coin-or.org/CoinUtils"
    > | #define COINUTILS_VERSION "2.9.11"
    > | #define COINUTILS_VERSION_MAJOR 2
    > | #define COINUTILS_VERSION_MINOR 9
    > | #define COINUTILS_VERSION_RELEASE 11
    > | #define COIN_COINUTILS_VERBOSITY 0
    > | #define COIN_COINUTILS_CHECKLEVEL 0
    > | #ifdef __cplusplus
    > | extern "C" void std::exit (int) throw (); using std::exit;
    > | #endif
    > | /* end confdefs.h.  */
    > |
    > | int
    > | main ()
    > | {
    > | int i=0; i++;
    > |   ;
    > |   return 0;
    > | }
    > configure:4045: WARNING: The flags CXXFLAGS="-O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long   -DCOINUTILS_BUILD" do not work.  I will now just try '-O', but you might want to set CXXFLAGS manually.
    
    to fail, because its g++ invocation including -pedantic-errors turns that
    
    > 'void std::exit(int)' has not been declared within 'std'
    
    warning into an error.
    
    There were similar build failures in the Cgl,
    
    >  ~/gcc/trunk/inst/bin/g++ -DHAVE_CONFIG_H -I. -I. -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -DCOIN_HAS_CLP -O -MT ClpCholeskyDense.lo -MD -MP -MF .deps/ClpCholeskyDense.Tpo -c ClpCholeskyDense.cpp  -fPIC -DPIC -o .libs/ClpCholeskyDense.o
    > In file included from ClpCholeskyDense.cpp:11:
    > ClpHelperFunctions.hpp:16:4: error: #error "don't have header file for math"
    >    16 | #  error "don't have header file for math"
    >       |    ^~~~~
    > In file included from ClpCholeskyDense.cpp:11:
    > ClpHelperFunctions.hpp: In function 'double CoinSqrt(double)':
    > ClpHelperFunctions.hpp:81:13: error: 'sqrt' was not declared in this scope
    >    81 |      return sqrt(x);
    >       |             ^~~~
    
    and Clp,
    
    >  ~/gcc/trunk/inst/bin/g++ -DHAVE_CONFIG_H -I. -I. -I.. -I./.. -I./../CglGomory -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -I~/lo/core/workdir/UnpackedTarball/coinmp/Osi/src/Osi -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -I~/lo/core/workdir/UnpackedTarball/coinmp/Clp/src/OsiClp -I~/lo/core/workdir/UnpackedTarball/coinmp/Clp/src -I~/lo/core/workdir/UnpackedTarball/coinmp/CoinUtils/src -I~/lo/core/workdir/UnpackedTarball/coinmp/Osi/src/Osi -O -MT CglLandPValidator.lo -MD -MP -MF .deps/CglLandPValidator.Tpo -c CglLandPValidator.cpp  -fPIC -DPIC -o .libs/CglLandPValidator.o
    > CglLandPValidator.cpp: In member function 'int LAP::Validator::cleanCut(OsiRowCut&, const double*, const OsiSolverInterface&, const CglParam&, const double*, const double*)':
    > CglLandPValidator.cpp:66:22: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    >    66 |         double val = fabs(elems[i]);
    >       |                      ^~~~
    >       |                      labs
    > CglLandPValidator.cpp: In member function 'int LAP::Validator::cleanCut2(OsiRowCut&, const double*, const OsiSolverInterface&, const CglParam&, const double*, const double*)':
    > CglLandPValidator.cpp:189:23: error: 'fabs' was not declared in this scope; did you mean 'labs'?
    >   189 |     double smallest = fabs(rhs);
    >       |                       ^~~~
    >       |                       labs
    
    subdirectories, and which happened to get solved by the same approach of
    removing problematic ac_declaration values from configure.
    
    I am not sure what all that magic of determining that ac_declaration value is
    supposed to be good for.  There appears to be no trace of it in the
    corresponding configure.ac sources, so it likely was automatically added by some
    dated autotools (all three configure files mention "Generated by GNU
    Autoconf 2.59").  At least on a cursory look, the determined ac_declaration
    appears to only be used in configure itself, and not leak into the actual coinmp
    build stage, so dropping the problematic ac_declaration values is hopefully
    harmless.  These three subdirectories were all that failed for me, but there
    might still be silent issues in other subdirectories when a problematic
    ac_declaration value would negatively affect other configure checks.  (An
    alternative approach could be to regenerate all the configure files from their
    configure.ac sources with a recent autotools.  But at least some of the existing
    external/coinmp/*.patch* already change such configure files, which would need
    to be adapted.)
    
    Change-Id: I0a33b0f654800e8288d3ca28e26a64efc23a3f6b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103756
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 762aacc4e055fffbc605be81f66f2274dccb4be8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114999
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 802b76340082e817efe67a5be4a021cb998a28a2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115502
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index c1f3df9866b1..a918effb1203 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
 	external/coinmp/rpath.patch \
 	external/coinmp/libtool.patch \
 	external/coinmp/register.patch \
+	external/coinmp/configure-exit.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/coinmp/configure-exit.patch b/external/coinmp/configure-exit.patch
new file mode 100644
index 000000000000..0a81b8073fd2
--- /dev/null
+++ b/external/coinmp/configure-exit.patch
@@ -0,0 +1,33 @@
+--- Cgl/configure
++++ Cgl/configure
+@@ -3501,8 +3501,6 @@
+ fi
+ for ac_declaration in \
+    '' \
+-   'extern "C" void std::exit (int) throw (); using std::exit;' \
+-   'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+    'extern "C" void exit (int);' \
+    'void exit (int);'
+--- Clp/configure
++++ Clp/configure
+@@ -3528,8 +3528,6 @@
+ fi
+ for ac_declaration in \
+    '' \
+-   'extern "C" void std::exit (int) throw (); using std::exit;' \
+-   'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+    'extern "C" void exit (int);' \
+    'void exit (int);'
+--- CoinUtils/configure
++++ CoinUtils/configure
+@@ -3527,8 +3527,6 @@
+ fi
+ for ac_declaration in \
+    '' \
+-   'extern "C" void std::exit (int) throw (); using std::exit;' \
+-   'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+    'extern "C" void exit (int);' \
+    'void exit (int);'
commit 7c6f86f10a614b64d7c7097a06670358e11d8cf4
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Jul 20 16:23:18 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:52 2021 +0200

    external/coinmp: C++17 no longer supports "register"
    
    ...and GCC 11 trunk g++ now defaults to C++17, so compilation started to fail
    with that compiler
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99082
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit ad607d898f9826c6fa144783c93541a10ad4740c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114998
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 656085bf2757437a088058871573385ff45f8ef5)
    
    Change-Id: I792e4c7ff59ad88e5571163d5b2362fdb349667d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115501
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index 35cfbfcdbae8..c1f3df9866b1 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
 	external/coinmp/ubsan.patch.0 \
 	external/coinmp/rpath.patch \
 	external/coinmp/libtool.patch \
+	external/coinmp/register.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/coinmp/register.patch b/external/coinmp/register.patch
new file mode 100644
index 000000000000..cf4ca4d06c01
--- /dev/null
+++ b/external/coinmp/register.patch
@@ -0,0 +1,369 @@
+--- CoinUtils/src/CoinHelperFunctions.hpp
++++ CoinUtils/src/CoinHelperFunctions.hpp
+@@ -41,7 +41,7 @@
+     handled correctly. */
+ 
+ template <class T> inline void
+-CoinCopyN(register const T* from, const int size, register T* to)
++CoinCopyN(const T* from, const int size, T* to)
+ {
+     if (size == 0 || from == to)
+ 	return;
+@@ -52,10 +52,10 @@
+ 			"CoinCopyN", "");
+ #endif
+ 
+-    register int n = (size + 7) / 8;
++    int n = (size + 7) / 8;
+     if (to > from) {
+-	register const T* downfrom = from + size;
+-	register T* downto = to + size;
++	const T* downfrom = from + size;
++	T* downto = to + size;
+ 	// Use Duff's device to copy
+ 	switch (size % 8) {
+ 	case 0: do{     *--downto = *--downfrom;
+@@ -99,7 +99,7 @@
+     the difference down to int.  -- lh, 100823 --
+ */
+ template <class T> inline void
+-CoinCopy(register const T* first, register const T* last, register T* to)
++CoinCopy(const T* first, const T* last, T* to)
+ {
+     CoinCopyN(first, static_cast<int>(last-first), to);
+ }
+@@ -114,7 +114,7 @@
+     Note JJF - the speed claim seems to be false on IA32 so I have added 
+     CoinMemcpyN which can be used for atomic data */
+ template <class T> inline void
+-CoinDisjointCopyN(register const T* from, const int size, register T* to)
++CoinDisjointCopyN(const T* from, const int size, T* to)
+ {
+ #ifndef _MSC_VER
+     if (size == 0 || from == to)
+@@ -135,7 +135,7 @@
+ 	throw CoinError("overlapping arrays", "CoinDisjointCopyN", "");
+ #endif
+ 
+-    for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
++    for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
+ 	to[0] = from[0];
+ 	to[1] = from[1];
+ 	to[2] = from[2];
+@@ -167,8 +167,8 @@
+     are copied at a time. The source array is given by its first and "after
+     last" entry; the target array is given by its first entry. */
+ template <class T> inline void
+-CoinDisjointCopy(register const T* first, register const T* last,
+-		 register T* to)
++CoinDisjointCopy(const T* first, const T* last,
++		 T* to)
+ {
+     CoinDisjointCopyN(first, static_cast<int>(last - first), to);
+ }
+@@ -256,7 +256,7 @@
+     alternative coding if USE_MEMCPY defined*/
+ #ifndef COIN_USE_RESTRICT
+ template <class T> inline void
+-CoinMemcpyN(register const T* from, const int size, register T* to)
++CoinMemcpyN(const T* from, const int size, T* to)
+ {
+ #ifndef _MSC_VER
+ #ifdef USE_MEMCPY
+@@ -296,7 +296,7 @@
+ 	throw CoinError("overlapping arrays", "CoinMemcpyN", "");
+ #endif
+ 
+-    for (register int n = size / 8; n > 0; --n, from += 8, to += 8) {
++    for (int n = size / 8; n > 0; --n, from += 8, to += 8) {
+ 	to[0] = from[0];
+ 	to[1] = from[1];
+ 	to[2] = from[2];
+@@ -343,8 +343,8 @@
+     are copied at a time. The source array is given by its first and "after
+     last" entry; the target array is given by its first entry. */
+ template <class T> inline void
+-CoinMemcpy(register const T* first, register const T* last,
+-	   register T* to)
++CoinMemcpy(const T* first, const T* last,
++	   T* to)
+ {
+     CoinMemcpyN(first, static_cast<int>(last - first), to);
+ }
+@@ -358,7 +358,7 @@
+     Note JJF - the speed claim seems to be false on IA32 so I have added 
+     CoinZero to allow for memset. */
+ template <class T> inline void
+-CoinFillN(register T* to, const int size, register const T value)
++CoinFillN(T* to, const int size, const T value)
+ {
+     if (size == 0)
+ 	return;
+@@ -369,7 +369,7 @@
+ 			"CoinFillN", "");
+ #endif
+ #if 1
+-    for (register int n = size / 8; n > 0; --n, to += 8) {
++    for (int n = size / 8; n > 0; --n, to += 8) {
+ 	to[0] = value;
+ 	to[1] = value;
+ 	to[2] = value;
+@@ -413,7 +413,7 @@
+     entries are filled at a time. The array is given by its first and "after
+     last" entry. */
+ template <class T> inline void
+-CoinFill(register T* first, register T* last, const T value)
++CoinFill(T* first, T* last, const T value)
+ {
+     CoinFillN(first, last - first, value);
+ }
+@@ -427,7 +427,7 @@
+     Note JJF - the speed claim seems to be false on IA32 so I have allowed 
+     for memset as an alternative */
+ template <class T> inline void
+-CoinZeroN(register T* to, const int size)
++CoinZeroN(T* to, const int size)
+ {
+ #ifdef USE_MEMCPY
+     // Use memset - seems faster on Intel with gcc
+@@ -448,7 +448,7 @@
+ 			"CoinZeroN", "");
+ #endif
+ #if 1
+-    for (register int n = size / 8; n > 0; --n, to += 8) {
++    for (int n = size / 8; n > 0; --n, to += 8) {
+ 	to[0] = 0;
+ 	to[1] = 0;
+ 	to[2] = 0;
+@@ -519,7 +519,7 @@
+     entries are filled at a time. The array is given by its first and "after
+     last" entry. */
+ template <class T> inline void
+-CoinZero(register T* first, register T* last)
++CoinZero(T* first, T* last)
+ {
+     CoinZeroN(first, last - first);
+ }
+@@ -545,7 +545,7 @@
+     This function was introduced because for some reason compiler tend to
+     handle the <code>max()</code> function differently. */
+ template <class T> inline T
+-CoinMax(register const T x1, register const T x2)
++CoinMax(const T x1, const T x2)
+ {
+     return (x1 > x2) ? x1 : x2;
+ }
+@@ -556,7 +556,7 @@
+     This function was introduced because for some reason compiler tend to
+     handle the min() function differently. */
+ template <class T> inline T
+-CoinMin(register const T x1, register const T x2)
++CoinMin(const T x1, const T x2)
+ {
+     return (x1 < x2) ? x1 : x2;
+ }
+@@ -578,7 +578,7 @@
+     according to operator<. The array is given by a pointer to its first entry
+     and by its size. */
+ template <class T> inline bool
+-CoinIsSorted(register const T* first, const int size)
++CoinIsSorted(const T* first, const int size)
+ {
+     if (size == 0)
+ 	return true;
+@@ -590,7 +590,7 @@
+ #if 1
+     // size1 is the number of comparisons to be made
+     const int size1 = size  - 1;
+-    for (register int n = size1 / 8; n > 0; --n, first += 8) {
++    for (int n = size1 / 8; n > 0; --n, first += 8) {
+ 	if (first[8] < first[7]) return false;
+ 	if (first[7] < first[6]) return false;
+ 	if (first[6] < first[5]) return false;
+@@ -627,7 +627,7 @@
+     according to operator<. The array is given by its first and "after
+     last" entry. */
+ template <class T> inline bool
+-CoinIsSorted(register const T* first, register const T* last)
++CoinIsSorted(const T* first, const T* last)
+ {
+     return CoinIsSorted(first, static_cast<int>(last - first));
+ }
+@@ -638,7 +638,7 @@
+     etc. For speed 8 entries are filled at a time. The array is given by a
+     pointer to its first entry and its size. */
+ template <class T> inline void
+-CoinIotaN(register T* first, const int size, register T init)
++CoinIotaN(T* first, const int size, T init)
+ {
+     if (size == 0)
+ 	return;
+@@ -648,7 +648,7 @@
+ 	throw CoinError("negative number of entries", "CoinIotaN", "");
+ #endif
+ #if 1
+-    for (register int n = size / 8; n > 0; --n, first += 8, init += 8) {
++    for (int n = size / 8; n > 0; --n, first += 8, init += 8) {
+ 	first[0] = init;
+ 	first[1] = init + 1;
+ 	first[2] = init + 2;
+@@ -706,7 +706,7 @@
+     integer array specified by the last two arguments (again, first and "after
+     last" entry). */
+ template <class T> inline T *
+-CoinDeleteEntriesFromArray(register T * arrayFirst, register T * arrayLast,
++CoinDeleteEntriesFromArray(T * arrayFirst, T * arrayLast,
+ 			   const int * firstDelPos, const int * lastDelPos)
+ {
+     int delNum = static_cast<int>(lastDelPos - firstDelPos);
+--- CoinUtils/src/CoinModelUseful2.cpp
++++ CoinUtils/src/CoinModelUseful2.cpp
+@@ -917,8 +917,8 @@
+   
+   int position=0;
+   int nEof=0; // Number of time send of string
+-  register int yystate;
+-  register int yyn;
++  int yystate;
++  int yyn;
+   int yyresult;
+   /* Number of tokens to shift before error messages enabled.  */
+   int yyerrstatus;
+@@ -936,12 +936,12 @@
+   /* The state stack.  */
+   short	yyssa[YYINITDEPTH];
+   short *yyss = yyssa;
+-  register short *yyssp;
++  short *yyssp;
+ 
+   /* The semantic value stack.  */
+   YYSTYPE yyvsa[YYINITDEPTH];
+   YYSTYPE *yyvs = yyvsa;
+-  register YYSTYPE *yyvsp;
++  YYSTYPE *yyvsp;
+ 
+ 
+ 
+--- CoinUtils/src/CoinOslC.h
++++ CoinUtils/src/CoinOslC.h
+@@ -34,30 +34,30 @@
+ extern "C"{
+ #endif
+ 
+-int c_ekkbtrn( register const EKKfactinfo *fact,
++int c_ekkbtrn( const EKKfactinfo *fact,
+ 	    double *dwork1,
+ 	    int * mpt,int first_nonzero);
+-int c_ekkbtrn_ipivrw( register const EKKfactinfo *fact,
++int c_ekkbtrn_ipivrw( const EKKfactinfo *fact,
+ 		   double *dwork1,
+ 		   int * mpt, int ipivrw,int * spare);
+ 
+-int c_ekketsj( register /*const*/ EKKfactinfo *fact,
++int c_ekketsj( /*const*/ EKKfactinfo *fact,
+ 	    double *dwork1,
+ 	    int *mpt2, double dalpha, int orig_nincol,
+ 	    int npivot, int *nuspikp,
+ 	    const int ipivrw, int * spare);
+-int c_ekkftrn( register const EKKfactinfo *fact, 
++int c_ekkftrn( const EKKfactinfo *fact, 
+ 	    double *dwork1,
+ 	    double * dpermu,int * mpt, int numberNonZero);
+ 
+-int c_ekkftrn_ft( register EKKfactinfo *fact, 
++int c_ekkftrn_ft( EKKfactinfo *fact, 
+ 	       double *dwork1, int *mpt, int *nincolp);
+-void c_ekkftrn2( register EKKfactinfo *fact, double *dwork1,
++void c_ekkftrn2( EKKfactinfo *fact, double *dwork1,
+ 	      double * dpermu1,int * mpt1, int *nincolp,
+ 	     double *dwork1_ft, int *mpt_ft, int *nincolp_ft);
+ 
+-int c_ekklfct( register EKKfactinfo *fact);
+-int c_ekkslcf( register const EKKfactinfo *fact);
++int c_ekklfct( EKKfactinfo *fact);
++int c_ekkslcf( const EKKfactinfo *fact);
+ inline void c_ekkscpy(int n, const int *marr1,int *marr2)
+ { CoinMemcpyN(marr1,n,marr2);} 
+ inline void c_ekkdcpy(int n, const double *marr1,double *marr2)
+--- CoinUtils/src/CoinOslFactorization2.cpp
++++ CoinUtils/src/CoinOslFactorization2.cpp
+@@ -20,9 +20,9 @@
+ extern int ets_count;
+ extern int ets_check;
+ #endif
+-#define COIN_REGISTER register
++#define COIN_REGISTER
+ #define COIN_REGISTER2
+-#define COIN_REGISTER3 register
++#define COIN_REGISTER3
+ #ifdef COIN_USE_RESTRICT
+ # define COIN_RESTRICT2 __restrict
+ #else
+--- CoinUtils/src/CoinOslFactorization3.cpp
++++ CoinUtils/src/CoinOslFactorization3.cpp
+@@ -1378,7 +1378,7 @@
+     }
+   }
+ } /* c_ekkmltf */
+-int c_ekklfct( register EKKfactinfo *fact)
++int c_ekklfct( EKKfactinfo *fact)
+ {
+   const int nrow	= fact->nrow;
+   int ninbas = fact->xcsadr[nrow+1]-1;
+@@ -2607,7 +2607,7 @@
+     }
+   }
+ } /* c_ekkclcp */
+-int c_ekkslcf( register const EKKfactinfo *fact)
++int c_ekkslcf( const EKKfactinfo *fact)
+ {
+   int * hrow = fact->xeradr;
+   int * hcol = fact->xecadr;
+--- CoinUtils/src/CoinPackedVectorBase.cpp
++++ CoinUtils/src/CoinPackedVectorBase.cpp
+@@ -194,8 +194,8 @@
+ double
+ CoinPackedVectorBase::oneNorm() const
+ {
+-   register double norm = 0.0;
+-   register const double* elements = getElements();
++   double norm = 0.0;
++   const double* elements = getElements();
+    for (int i = getNumElements() - 1; i >= 0; --i) {
+       norm += fabs(elements[i]);
+    }
+@@ -224,8 +224,8 @@
+ double
+ CoinPackedVectorBase::infNorm() const
+ {
+-   register double norm = 0.0;
+-   register const double* elements = getElements();
++   double norm = 0.0;
++   const double* elements = getElements();
+    for (int i = getNumElements() - 1; i >= 0; --i) {
+       norm = CoinMax(norm, fabs(elements[i]));
+    }
+--- CoinUtils/src/CoinSearchTree.hpp
++++ CoinUtils/src/CoinSearchTree.hpp
+@@ -153,8 +153,8 @@
+   static inline const char* name() { return "CoinSearchTreeComparePreferred"; }
+   inline bool operator()(const CoinTreeSiblings* x,
+ 			 const CoinTreeSiblings* y) const {
+-    register const CoinTreeNode* xNode = x->currentNode();
+-    register const CoinTreeNode* yNode = y->currentNode();
++    const CoinTreeNode* xNode = x->currentNode();
++    const CoinTreeNode* yNode = y->currentNode();
+     const BitVector128 xPref = xNode->getPreferred();
+     const BitVector128 yPref = yNode->getPreferred();
+     bool retval = true;
+--- CoinUtils/src/CoinSimpFactorization.cpp
++++ CoinUtils/src/CoinSimpFactorization.cpp
+@@ -2440,7 +2440,7 @@
+ 	const int row=secRowOfU_[i];
+ 	const int column=colOfU_[i];
+ 	if ( denseVector_[column]==0.0 ) continue;
+-	register const double multiplier=denseVector_[column]*invOfPivots_[row];
++	const double multiplier=denseVector_[column]*invOfPivots_[row];
+ 	denseVector_[column]=0.0;
+ 	const int rowBeg=UrowStarts_[row];
+ 	const int rowEnd=rowBeg+UrowLengths_[row];
commit aed21ef623820b36d4ced1fda5c20e2d0fa683a7
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 7 22:29:46 2020 +0200
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Fri May 14 14:02:52 2021 +0200

    external/liborcus: Missing includes
    
    ...as seen with recent GCC 11 trunk libstdc++:
    
    > orcus_xlsx.cpp: In function ‘size_t orcus::{anonymous}::get_schema_rank(orcus::schema_t)’:
    > orcus_xlsx.cpp:313:59: error: incomplete type ‘std::numeric_limits<long unsigned int>’ used in nested name specifier
    >   313 |     return it == rank_map.end() ? numeric_limits<size_t>::max() : it->second;
    >       |                                                           ^~~
    
    etc.
    
    Change-Id: If92cfb565ed9344b2ec1403793d7aeff8bd019ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104074
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit a9976a958b2857e308c6598532151878615bfd9f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114997
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit eaa9f84465eb330aa4c68711e8c8ec609503c5d3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115500
    Tested-by: Thorsten Behrens <thorsten.behrens at allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behrens at allotropia.de>

diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index e5e33b0b1249..113e8e25818d 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
 	external/liborcus/gcc9.patch.0 \
 	external/liborcus/libtool.patch.0 \
 	external/liborcus/fix-pch.patch.0 \
+	external/liborcus/include.patch.0 \
 ))
 
 ifeq ($(OS),WNT)
diff --git a/external/liborcus/include.patch.0 b/external/liborcus/include.patch.0
new file mode 100644
index 000000000000..9555dd534b3e
--- /dev/null
+++ b/external/liborcus/include.patch.0
@@ -0,0 +1,30 @@
+--- src/liborcus/orcus_xlsx.cpp
++++ src/liborcus/orcus_xlsx.cpp
+@@ -32,6 +32,7 @@
+ 
+ #include <cstdlib>
+ #include <iostream>
++#include <limits>
+ #include <string>
+ #include <cstring>
+ #include <sstream>
+--- src/liborcus/xls_xml_context.cpp
++++ src/liborcus/xls_xml_context.cpp
+@@ -16,6 +16,7 @@
+ #include <mdds/sorted_string_map.hpp>
+ 
+ #include <iostream>
++#include <limits>
+ 
+ using namespace std;
+ 
+--- src/liborcus/xlsx_revision_context.cpp
++++ src/liborcus/xlsx_revision_context.cpp
+@@ -16,6 +16,7 @@
+ #include "orcus/global.hpp"
+ 
+ #include <iostream>
++#include <limits>
+ 
+ using namespace std;
+ 


More information about the Libreoffice-commits mailing list