[Libreoffice-commits] core.git: 8 commits - bridges/source config_host/config_cxxabi.h.in config_host/config_gcc.h.in configure.ac external/opencollada

Stephan Bergmann sbergman at redhat.com
Fri Feb 26 07:58:39 UTC 2016


 bridges/source/cpp_uno/gcc3_linux_intel/share.hxx    |   19 --
 bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx  |    4 
 bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx   |  172 ++++++++++---------
 bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx |   10 -
 config_host/config_cxxabi.h.in                       |   25 ++
 config_host/config_gcc.h.in                          |   19 --
 configure.ac                                         |   84 ++++++++-
 external/opencollada/UnpackedTarball_opencollada.mk  |    1 
 external/opencollada/patches/libc++.patch.0          |   21 ++
 9 files changed, 232 insertions(+), 123 deletions(-)

New commits:
commit 49f81b3f33e1b043a1615855503768d78db5f093
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 26 08:11:42 2016 +0100

    external/opencollada: Adapt to clang -stdlib=libc++
    
    For one, libc++ has no <tr1/unordered_*> headers, and for another, std::isnan
    needs <cmath>.
    
    Change-Id: I39179a9069826cb08bac19c0f6e56acdc1ab6b9d

diff --git a/external/opencollada/UnpackedTarball_opencollada.mk b/external/opencollada/UnpackedTarball_opencollada.mk
index a183792..f70cc2a 100644
--- a/external/opencollada/UnpackedTarball_opencollada.mk
+++ b/external/opencollada/UnpackedTarball_opencollada.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,opencollada,\
 	external/opencollada/patches/0002-Expose-sid-for-textures-in-extras.patch.1 \
 	external/opencollada/patches/opencollada.clang.patch.0 \
 	external/opencollada/patches/opencollada.libxml.patch.0 \
+	external/opencollada/patches/libc++.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/opencollada/patches/libc++.patch.0 b/external/opencollada/patches/libc++.patch.0
new file mode 100644
index 0000000..bcf5b2c
--- /dev/null
+++ b/external/opencollada/patches/libc++.patch.0
@@ -0,0 +1,21 @@
+--- COLLADABaseUtils/include/COLLADABUhash_map.h
++++ COLLADABaseUtils/include/COLLADABUhash_map.h
+@@ -60,7 +60,7 @@
+         #define COLLADABU_HASH_NAMESPACE_CLOSE }
+         #define COLLADABU_HASH_FUN hash
+     #endif
+-#elif (defined(__APPLE__) || defined(__FreeBSD__)) && defined(_LIBCPP_VERSION)
++#elif defined(_LIBCPP_VERSION)
+     #include <unordered_map>
+     #include <unordered_set>
+     #define COLLADABU_HASH_MAP std::unordered_map
+--- GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
++++ GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp
+@@ -10,6 +10,7 @@
+ 
+ #include "GeneratedSaxParserUtils.h"
+ #include <math.h>
++#include <cmath>
+ #include <memory>
+ #include <string.h>
+ #include <limits>
commit 1e161eb96e4ed72e43c158253069f974fff5b36f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 26 08:10:38 2016 +0100

    Use config_cxxabi.h to check for __*class_type_info
    
    ...as needed e.g. when building on Linux with clang -stdlib=libc++ against
    libc++abi
    
    Change-Id: I1f6f5ebcf5410c65453549ecea77581ccdaabc17

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 0c9e2c5..bac7ef6 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -33,25 +33,72 @@
 #include "uno/any2.h"
 #include "uno/mapping.h"
 
-#ifdef _LIBCPP_VERSION
+#if !HAVE_CXXABI_H_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __class_type_info: public std::type_info {
+public:
+    explicit __class_type_info(char const * n): type_info(n) {}
+    ~__class_type_info() override;
+};
+}
+#endif
 
-namespace __cxxabiv1
-{
-    struct __class_type_info : public std::type_info
-    {
-        explicit __class_type_info( const char *__n ) : type_info( __n ) { }
-        virtual ~__class_type_info();
-    };
+#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __si_class_type_info: public __class_type_info {
+public:
+    __class_type_info const * __base_type;
+    explicit __si_class_type_info(
+        char const * n, __class_type_info const *base):
+        __class_type_info(n), __base_type(base) {}
+    ~__si_class_type_info() override;
+};
+}
+#endif
 
-    struct __si_class_type_info : public __class_type_info
-    {
-        explicit __si_class_type_info( const char *__n, const __class_type_info *__b ) :
-            __class_type_info( __n ), __base_type( __b ) { }
-        virtual ~__si_class_type_info();
-        const __class_type_info *__base_type;
+#if !HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+struct __base_class_type_info {
+    __class_type_info const * __base_type;
+#if defined _GLIBCXX_LLP64
+    long long __offset_flags;
+#else
+    long __offset_flags;
+#endif
+    enum __offset_flags_masks {
+        __virtual_mask = 0x1,
+        __public_mask = 0x2,
+        __offset_shift = 8
     };
+};
 }
+#endif
 
+#if !HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
+// libstdc++-v3/libsupc++/cxxabi.h:
+namespace __cxxabiv1 {
+class __vmi_class_type_info: public __class_type_info {
+public:
+    unsigned int __flags;
+    unsigned int __base_count;
+    __base_class_type_info __base_info[1];
+    enum __flags_masks {
+        __non_diamond_repeat_mask = 0x1,
+        __diamond_shaped_mask = 0x2,
+        __flags_unknown_mask = 0x10
+    };
+    explicit __vmi_class_type_info(char const * n, int flags):
+        __class_type_info(n), __flags(flags), __base_count(0) {}
+    ~__vmi_class_type_info() override;
+};
+}
 #endif
 
 #if !HAVE_CXXABI_H_CXA_EH_GLOBALS
diff --git a/config_host/config_cxxabi.h.in b/config_host/config_cxxabi.h.in
index 09bf8ab..74a226b 100644
--- a/config_host/config_cxxabi.h.in
+++ b/config_host/config_cxxabi.h.in
@@ -10,11 +10,15 @@
 #ifndef CONFIG_CXXABI_H
 #define CONFIG_CXXABI_H
 
+#define HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO 0
+#define HAVE_CXXABI_H_CLASS_TYPE_INFO 0
 #define HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0
 #define HAVE_CXXABI_H_CXA_EH_GLOBALS 0
 #define HAVE_CXXABI_H_CXA_EXCEPTION 0
 #define HAVE_CXXABI_H_CXA_GET_GLOBALS 0
 #define HAVE_CXXABI_H_CXA_THROW 0
+#define HAVE_CXXABI_H_SI_CLASS_TYPE_INFO 0
+#define HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO 0
 
 #endif
 
diff --git a/configure.ac b/configure.ac
index 9b1f2dc..de6eaae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6043,6 +6043,30 @@ if test "$GCC" = "yes"; then
         ], [AC_MSG_RESULT([no])])
     CFLAGS=$save_CFLAGS
 
+    AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+            #include <cstddef>
+            #include <cxxabi.h>
+            std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
+        ])], [
+            AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
+            AC_MSG_RESULT([yes])
+        ], [AC_MSG_RESULT([no])])
+    AC_LANG_POP([C++])
+
+    AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+            #include <cstddef>
+            #include <cxxabi.h>
+            std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
+        ])], [
+            AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
+            AC_MSG_RESULT([yes])
+        ], [AC_MSG_RESULT([no])])
+    AC_LANG_POP([C++])
+
     AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
     AC_LANG_PUSH([C++])
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
@@ -6100,6 +6124,30 @@ if test "$GCC" = "yes"; then
         ], [AC_MSG_RESULT([no])])
     AC_LANG_POP([C++])
 
+    AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+            #include <cstddef>
+            #include <cxxabi.h>
+            std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
+        ])], [
+            AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
+            AC_MSG_RESULT([yes])
+        ], [AC_MSG_RESULT([no])])
+    AC_LANG_POP([C++])
+
+    AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+            #include <cstddef>
+            #include <cxxabi.h>
+            std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
+        ])], [
+            AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
+            AC_MSG_RESULT([yes])
+        ], [AC_MSG_RESULT([no])])
+    AC_LANG_POP([C++])
+
     AC_MSG_CHECKING([whether STL uses __attribute__((warn_unused))])
     AC_LANG_PUSH([C++])
     save_CXXFLAGS=$CXXFLAGS
commit 3d63d0c14b1c86f22f73a80e42b84e0256fdf818
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 26 08:05:38 2016 +0100

    Adapt __cxxabiv1 for libc++abi
    
    ...where it has an additional nonstandard member, at least on Linux x86-64.  Not
    sure whether
    
      #if defined _LIBCPPABI_VERSION
    
    is the best way to distinguish libc++abi from other C++ runtimes, but
    
      #define _LIBCPPABI_VERSION 1002
    
    is what it has in its cxxabi.h.
    
    Change-Id: I9edbca27aa2bedbc5b2e996fd5ffcfc2e8eb42d9

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 5259862..0c9e2c5 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -55,9 +55,15 @@ namespace __cxxabiv1
 #endif
 
 #if !HAVE_CXXABI_H_CXA_EH_GLOBALS
-// <https://mentorembedded.github.io/cxx-abi/abi-eh.html>:
+// <https://mentorembedded.github.io/cxx-abi/abi-eh.html>,
+// libcxxabi/src/cxa_exception.hpp:
 namespace __cxxabiv1 {
 struct __cxa_exception {
+#if defined _LIBCPPABI_VERSION // detect libc++abi
+#if defined __LP64__ || LIBCXXABI_ARM_EHABI
+    std::size_t referenceCount;
+#endif
+#endif
     std::type_info * exceptionType;
     void (* exceptionDestructor)(void *);
     std::unexpected_handler unexpectedHandler;
commit 4cb9d7d1c49d435d789ede63a89111a6d01260cf
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 25 21:16:53 2016 +0100

    Assume HAVE_THREADSAFE_STATICS=TRUE for Clang with -stdlib=libc++
    
    Change-Id: I6a38019d5ede6c10b3f33f4a9b078253e4159e71

diff --git a/configure.ac b/configure.ac
index 658f2c8..9b1f2dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5946,9 +5946,11 @@ if test "$GCC" = "yes"; then
             AC_LANG_PUSH([C++])
             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <list>
-#if !defined __GLIBCXX__ ||(__GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306)
+#if defined __GLIBCXX__
+#if __GLIBCXX__ < 20080606 && __GLIBCXX__ != 20080306
 #error
 #endif
+#endif
                 ]])],[HAVE_THREADSAFE_STATICS=TRUE],[])
             AC_LANG_POP([C++])
         else # known to work in GCC since version 4.3
commit 0fef230f0f58bcdebce56bc0439f7efade99a7c5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 25 20:55:50 2016 +0100

    Declarations based on config_cxxabi.h should be unrelated to _LIBCPP_VERSION
    
    Change-Id: I79049fefad8b626b5c58728b9c05c4952fb97f1a

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 4112114..5259862 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -50,14 +50,9 @@ namespace __cxxabiv1
         virtual ~__si_class_type_info();
         const __class_type_info *__base_type;
     };
-
-extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) _NOEXCEPT;
-
-extern "C" _LIBCPP_NORETURN void __cxa_throw(
-    void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) );
 }
 
-#else
+#endif
 
 #if !HAVE_CXXABI_H_CXA_EH_GLOBALS
 // <https://mentorembedded.github.io/cxx-abi/abi-eh.html>:
@@ -109,8 +104,6 @@ extern "C" void __cxa_throw(
 }
 #endif
 
-#endif
-
 extern "C" void privateSnippetExecutor( ... );
 
 namespace CPPU_CURRENT_NAMESPACE
commit 069506bcb0ee4005b01c22095ed427b96b553c98
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 25 20:52:31 2016 +0100

    Use config_cxxabi.h to check for __cxa_eh_globals, __cxa_exception
    
    Change-Id: I467341da4bccb3afb82518b444cd101b3cdaacc9

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
index 5efd7cb..04d13e80 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx
@@ -81,7 +81,7 @@ static OUString toUNOname( char const * p )
 extern "C" {
 static void _GLIBCXX_CDTOR_CALLABI deleteException( void * pExc )
 {
-    __cxa_exception const * header = (static_cast<__cxa_exception const *>(pExc) - 1);
+    __cxxabiv1::__cxa_exception const * header = (static_cast<__cxxabiv1::__cxa_exception const *>(pExc) - 1);
     typelib_TypeDescription * pTD = nullptr;
     OUString unoName( toUNOname( header->exceptionType->name() ) );
     ::typelib_typedescription_getByName( &pTD, unoName.pData );
@@ -138,7 +138,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
     __cxxabiv1::__cxa_throw( pCppExc, rtti, deleteException );
 }
 
-void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping * pCpp2Uno )
+void fillUnoException( __cxxabiv1::__cxa_exception * header, uno_Any * pUnoExc, uno_Mapping * pCpp2Uno )
 {
     if (! header)
     {
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 19399f3..4112114 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -59,53 +59,40 @@ extern "C" _LIBCPP_NORETURN void __cxa_throw(
 
 #else
 
-namespace CPPU_CURRENT_NAMESPACE
-{
-
-// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h
-
-struct __cxa_exception
-{
-    ::std::type_info *exceptionType;
-    void (*exceptionDestructor)(void *);
-
-    ::std::unexpected_handler unexpectedHandler;
-    ::std::terminate_handler terminateHandler;
-
-    __cxa_exception *nextException;
-
+#if !HAVE_CXXABI_H_CXA_EH_GLOBALS
+// <https://mentorembedded.github.io/cxx-abi/abi-eh.html>:
+namespace __cxxabiv1 {
+struct __cxa_exception {
+    std::type_info * exceptionType;
+    void (* exceptionDestructor)(void *);
+    std::unexpected_handler unexpectedHandler;
+    std::terminate_handler terminateHandler;
+    __cxa_exception * nextException;
     int handlerCount;
-
     int handlerSwitchValue;
-    const unsigned char *actionRecord;
-    const unsigned char *languageSpecificData;
-    void *catchTemp;
-    void *adjustedPtr;
-
+    char const * actionRecord;
+    char const * languageSpecificData;
+    void * catchTemp;
+    void * adjustedPtr;
     _Unwind_Exception unwindHeader;
 };
+}
+#endif
 
-struct __cxa_eh_globals
-{
-    __cxa_exception *caughtExceptions;
+#if !HAVE_CXXABI_H_CXA_EH_GLOBALS
+// <https://mentorembedded.github.io/cxx-abi/abi-eh.html>:
+namespace __cxxabiv1 {
+struct __cxa_eh_globals {
+    __cxa_exception * caughtExceptions;
     unsigned int uncaughtExceptions;
 };
-
 }
-
-// __cxa_get_globals is exported from libstdc++ since GCC 3.4.0 (CXXABI_1.3),
-// but it is only declared in cxxabi.h (in namespace __cxxabiv1) since
-// GCC 4.7.0.  It returns a pointer to a struct __cxa_eh_globals, but that
-// struct is only incompletely declared even in the GCC 4.7.0 cxxabi.h.
-// Therefore, provide a declaration here for old GCC (libstdc++, really) version
-// that returns a void pointer, and in the code calling it always cast to the
-// above fake definition of CPPU_CURRENT_NAMESPACE::__cxa_eh_globals (which
-// hopefully keeps matching the real definition in libstdc++); similarly for
-// __cxa_allocate_exception and __cxa_throw, though they do not have the
-// additional problem of an incompletely declared return type:
+#endif
 
 #if !HAVE_CXXABI_H_CXA_GET_GLOBALS
-namespace __cxxabiv1 { extern "C" void * __cxa_get_globals() throw(); }
+namespace __cxxabiv1 {
+extern "C" __cxa_eh_globals * __cxa_get_globals() throw();
+}
 #endif
 
 #if !HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION
@@ -133,11 +120,7 @@ void raiseException(
     uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
 
 void fillUnoException(
-#ifdef _LIBCPP_VERSION
     __cxxabiv1::__cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
-#else
-    __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
-#endif
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
index a468691..1f85882 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
@@ -294,17 +294,9 @@ static void cpp_call(
      catch (...)
      {
          // fill uno exception
-#ifdef _LIBCPP_VERSION
          CPPU_CURRENT_NAMESPACE::fillUnoException(
-             reinterpret_cast< __cxxabiv1::__cxa_eh_globals * >(
-                 __cxxabiv1::__cxa_get_globals())->caughtExceptions,
+             __cxxabiv1::__cxa_get_globals()->caughtExceptions,
              *ppUnoExc, pThis->getBridge()->getCpp2Uno());
-#else
-         fillUnoException(
-             reinterpret_cast< CPPU_CURRENT_NAMESPACE::__cxa_eh_globals * >(
-                 __cxxabiv1::__cxa_get_globals())->caughtExceptions,
-             *ppUnoExc, pThis->getBridge()->getCpp2Uno());
-#endif
 
         // temporary params
         for ( ; nTempIndices--; )
diff --git a/config_host/config_cxxabi.h.in b/config_host/config_cxxabi.h.in
index e3bb801..09bf8ab 100644
--- a/config_host/config_cxxabi.h.in
+++ b/config_host/config_cxxabi.h.in
@@ -11,6 +11,8 @@
 #define CONFIG_CXXABI_H
 
 #define HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0
+#define HAVE_CXXABI_H_CXA_EH_GLOBALS 0
+#define HAVE_CXXABI_H_CXA_EXCEPTION 0
 #define HAVE_CXXABI_H_CXA_GET_GLOBALS 0
 #define HAVE_CXXABI_H_CXA_THROW 0
 
diff --git a/configure.ac b/configure.ac
index 1043c9f..658f2c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6052,6 +6052,30 @@ if test "$GCC" = "yes"; then
         ], [AC_MSG_RESULT([no])])
     AC_LANG_POP([C++])
 
+    AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+            #include <cstddef>
+            #include <cxxabi.h>
+            std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
+        ])], [
+            AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
+            AC_MSG_RESULT([yes])
+        ], [AC_MSG_RESULT([no])])
+    AC_LANG_POP([C++])
+
+    AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+            #include <cstddef>
+            #include <cxxabi.h>
+            std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
+        ])], [
+            AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
+            AC_MSG_RESULT([yes])
+        ], [AC_MSG_RESULT([no])])
+    AC_LANG_POP([C++])
+
     AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
     AC_LANG_PUSH([C++])
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
commit 128deeae81a6f802bfb79b8f0fa8c4b10729f7db
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 25 20:27:59 2016 +0100

    cxxabi.h is not specific to GCC
    
    Change-Id: Icaf4d4d41a36ae469f826ac08ab641a554dff3c9

diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
index bf9c501..f97e81e 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
@@ -29,7 +29,7 @@
 #endif
 #include <unwind.h>
 
-#include "config_gcc.h"
+#include "config_cxxabi.h"
 #include <uno/any2.h>
 #include "uno/mapping.h"
 
@@ -80,17 +80,17 @@ struct __cxa_eh_globals
 // __cxa_allocate_exception and __cxa_throw, though they do not have the
 // additional problem of an incompletely declared return type:
 
-#if !HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS
+#if !HAVE_CXXABI_H_CXA_GET_GLOBALS
 namespace __cxxabiv1 { extern "C" void * __cxa_get_globals() throw(); }
 #endif
 
-#if !HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION
+#if !HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION
 namespace __cxxabiv1 {
 extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw();
 }
 #endif
 
-#if !HAVE_GCC_CXXABI_H_CXA_THROW
+#if !HAVE_CXXABI_H_CXA_THROW
 namespace __cxxabiv1 {
 extern "C" void __cxa_throw(
     void * thrown_exception, void * tinfo, void (* dest)(void *))
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 096c7d4..19399f3 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -29,7 +29,7 @@
 #endif
 #include <unwind.h>
 
-#include "config_gcc.h"
+#include "config_cxxabi.h"
 #include "uno/any2.h"
 #include "uno/mapping.h"
 
@@ -104,17 +104,17 @@ struct __cxa_eh_globals
 // __cxa_allocate_exception and __cxa_throw, though they do not have the
 // additional problem of an incompletely declared return type:
 
-#if !HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS
+#if !HAVE_CXXABI_H_CXA_GET_GLOBALS
 namespace __cxxabiv1 { extern "C" void * __cxa_get_globals() throw(); }
 #endif
 
-#if !HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION
+#if !HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION
 namespace __cxxabiv1 {
 extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw();
 }
 #endif
 
-#if !HAVE_GCC_CXXABI_H_CXA_THROW
+#if !HAVE_CXXABI_H_CXA_THROW
 namespace __cxxabiv1 {
 extern "C" void __cxa_throw(
     void * thrown_exception, void * tinfo, void (* dest)(void *))
diff --git a/config_host/config_gcc.h.in b/config_host/config_cxxabi.h.in
similarity index 69%
rename from config_host/config_gcc.h.in
rename to config_host/config_cxxabi.h.in
index c957179..e3bb801 100644
--- a/config_host/config_gcc.h.in
+++ b/config_host/config_cxxabi.h.in
@@ -7,12 +7,12 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef CONFIG_GCC_H
-#define CONFIG_GCC_H
+#ifndef CONFIG_CXXABI_H
+#define CONFIG_CXXABI_H
 
-#define HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0
-#define HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS 0
-#define HAVE_GCC_CXXABI_H_CXA_THROW 0
+#define HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0
+#define HAVE_CXXABI_H_CXA_GET_GLOBALS 0
+#define HAVE_CXXABI_H_CXA_THROW 0
 
 #endif
 
diff --git a/configure.ac b/configure.ac
index 7825349..1043c9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6047,7 +6047,7 @@ if test "$GCC" = "yes"; then
             #include <cxxabi.h>
             void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
         ])], [
-            AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
+            AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
             AC_MSG_RESULT([yes])
         ], [AC_MSG_RESULT([no])])
     AC_LANG_POP([C++])
@@ -6058,7 +6058,7 @@ if test "$GCC" = "yes"; then
             #include <cxxabi.h>
             void * f() { return __cxxabiv1::__cxa_get_globals(); }
         ])], [
-            AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS],[1])
+            AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
             AC_MSG_RESULT([yes])
         ], [AC_MSG_RESULT([no])])
     AC_LANG_POP([C++])
@@ -6069,7 +6069,7 @@ if test "$GCC" = "yes"; then
             #include <cxxabi.h>
             void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
         ])], [
-            AC_DEFINE([HAVE_GCC_CXXABI_H_CXA_THROW],[1])
+            AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
             AC_MSG_RESULT([yes])
         ], [AC_MSG_RESULT([no])])
     AC_LANG_POP([C++])
@@ -12855,10 +12855,10 @@ AC_CONFIG_HEADERS([config_host/config_eot.h])
 AC_CONFIG_HEADERS([config_host/config_extension_update.h])
 AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
 AC_CONFIG_HEADERS([config_host/config_cups.h])
+AC_CONFIG_HEADERS([config_host/config_cxxabi.h])
 AC_CONFIG_HEADERS([config_host/config_dbus.h])
 AC_CONFIG_HEADERS([config_host/config_features.h])
 AC_CONFIG_HEADERS([config_host/config_folders.h])
-AC_CONFIG_HEADERS([config_host/config_gcc.h])
 AC_CONFIG_HEADERS([config_host/config_gio.h])
 AC_CONFIG_HEADERS([config_host/config_global.h])
 AC_CONFIG_HEADERS([config_host/config_graphite.h])
commit baad027bb7d4e4cd3c80ec3051741d21a8d23511
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 25 19:51:41 2016 +0100

    Expect _Unwind_Exception to be defined in the compilers' unwind.h
    
    Change-Id: Ie27018d21cf356ea5c6953958b466153f93f9a51

diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
index 512ae6d..bf9c501 100644
--- a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
@@ -27,6 +27,7 @@
 #ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
 #define _GLIBCXX_CDTOR_CALLABI
 #endif
+#include <unwind.h>
 
 #include "config_gcc.h"
 #include <uno/any2.h>
@@ -37,15 +38,7 @@ namespace CPPU_CURRENT_NAMESPACE
 
 void dummy_can_throw_anything( char const * );
 
-// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
-
-struct _Unwind_Exception
-{
-    unsigned exception_class __attribute__((__mode__(__DI__)));
-    void * exception_cleanup;
-    unsigned private_1 __attribute__((__mode__(__word__)));
-    unsigned private_2 __attribute__((__mode__(__word__)));
-} __attribute__((__aligned__));
+// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h
 
 struct __cxa_exception
 {
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
index 96ddfc0..096c7d4 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx
@@ -27,6 +27,7 @@
 #ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
 #define _GLIBCXX_CDTOR_CALLABI
 #endif
+#include <unwind.h>
 
 #include "config_gcc.h"
 #include "uno/any2.h"
@@ -61,15 +62,7 @@ extern "C" _LIBCPP_NORETURN void __cxa_throw(
 namespace CPPU_CURRENT_NAMESPACE
 {
 
-// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
-
-struct _Unwind_Exception
-{
-    unsigned exception_class __attribute__((__mode__(__DI__)));
-    void * exception_cleanup;
-    unsigned private_1 __attribute__((__mode__(__word__)));
-    unsigned private_2 __attribute__((__mode__(__word__)));
-} __attribute__((__aligned__));
+// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h
 
 struct __cxa_exception
 {


More information about the Libreoffice-commits mailing list