From ae040c70448f47c0a3a772d86e89257e82107afc Mon Sep 17 00:00:00 2001 From: bapt Date: Sun, 13 Nov 2016 22:38:15 +0000 Subject: Fix runtime issues related to thread_locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __cxa_thread_atexit which is needed when building c++11 program using thread_locale is only defined on FreeBSD 11-STABLE and 12-CURRENT Backout the change in libreoffice which happened during the 5.2 dev phase adding thread_locale PR: 214473 Reported by: Dušan Vejnovič Tested by: Dušan Vejnovič --- editors/libreoffice/Makefile.common | 2 +- editors/libreoffice/files/patch-Makefile.in | 2 +- .../files/patch-vcl_inc_unx_gtk_gtkinst.hxx | 11 ++++++ .../files/patch-vcl_unx_gtk_gtkinst.cxx | 42 ++++++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 editors/libreoffice/files/patch-vcl_inc_unx_gtk_gtkinst.hxx create mode 100644 editors/libreoffice/files/patch-vcl_unx_gtk_gtkinst.cxx (limited to 'editors') diff --git a/editors/libreoffice/Makefile.common b/editors/libreoffice/Makefile.common index 625d06b67522..b583242118c0 100644 --- a/editors/libreoffice/Makefile.common +++ b/editors/libreoffice/Makefile.common @@ -2,7 +2,7 @@ PORTNAME= libreoffice PORTVERSION= 5.2.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES+= editors MAINTAINER= office@FreeBSD.org diff --git a/editors/libreoffice/files/patch-Makefile.in b/editors/libreoffice/files/patch-Makefile.in index 39b5fb6385a5..ac32968f9684 100644 --- a/editors/libreoffice/files/patch-Makefile.in +++ b/editors/libreoffice/files/patch-Makefile.in @@ -1,4 +1,4 @@ ---- Makefile.in.orig 2016-11-11 12:49:08 UTC +--- Makefile.in.orig 2016-10-28 14:50:26 UTC +++ Makefile.in @@ -52,7 +52,7 @@ $(BUILDDIR)/config_host.mk : $(wildcard diff --git a/editors/libreoffice/files/patch-vcl_inc_unx_gtk_gtkinst.hxx b/editors/libreoffice/files/patch-vcl_inc_unx_gtk_gtkinst.hxx new file mode 100644 index 000000000000..c9ab6a82b920 --- /dev/null +++ b/editors/libreoffice/files/patch-vcl_inc_unx_gtk_gtkinst.hxx @@ -0,0 +1,11 @@ +--- vcl/inc/unx/gtk/gtkinst.hxx.orig 2016-10-28 14:50:26 UTC ++++ vcl/inc/unx/gtk/gtkinst.hxx +@@ -46,7 +46,7 @@ class GtkPrintWrapper; + class GenPspGraphics; + class GtkYieldMutex : public SalYieldMutex + { +- thread_local static std::stack yieldCounts; ++ std::list aYieldStack; + + public: + GtkYieldMutex() {} diff --git a/editors/libreoffice/files/patch-vcl_unx_gtk_gtkinst.cxx b/editors/libreoffice/files/patch-vcl_unx_gtk_gtkinst.cxx new file mode 100644 index 000000000000..b53a62613794 --- /dev/null +++ b/editors/libreoffice/files/patch-vcl_unx_gtk_gtkinst.cxx @@ -0,0 +1,42 @@ +--- vcl/unx/gtk/gtkinst.cxx.orig 2016-11-13 15:24:04 UTC ++++ vcl/unx/gtk/gtkinst.cxx +@@ -298,28 +298,29 @@ SalPrinter* GtkInstance::CreatePrinter( + * for each pair, so we can accurately restore + * it later. + */ +-thread_local std::stack GtkYieldMutex::yieldCounts; + + void GtkYieldMutex::ThreadsEnter() + { + acquire(); +- if (!yieldCounts.empty()) { +- auto n = yieldCounts.top(); +- yieldCounts.pop(); +- for (; n != 0; --n) { ++ if( !aYieldStack.empty() ) ++ { /* Previously called ThreadsLeave() */ ++ sal_uLong nCount = aYieldStack.front(); ++ aYieldStack.pop_front(); ++ while( nCount-- > 1 ) + acquire(); +- } + } + } + + void GtkYieldMutex::ThreadsLeave() + { ++ aYieldStack.push_front( mnCount ); + assert(mnCount != 0); +- auto n = mnCount - 1; +- yieldCounts.push(n); +- for (sal_uIntPtr i = 0; i != n + 1; ++i) { ++ SAL_WARN_IF( ++ mnThreadId && mnThreadId != osl::Thread::getCurrentIdentifier(), ++ "vcl.gtk", "other thread " << mnThreadId << " owns the mutex"); ++ while( mnCount > 1 ) + release(); +- } ++ release(); + } + + SalVirtualDevice* GtkInstance::CreateVirtualDevice( SalGraphics *pG, -- cgit