summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Giffuni <pfg@apache.org>2015-03-26 22:07:21 +0000
committerPedro Giffuni <pfg@apache.org>2015-03-26 22:07:21 +0000
commit5bffd35f5bc0a58773f838bb420d434c449f6c6a (patch)
tree79d15ed90abe18263e7ed5fd6631e872cd10bfd1
parent50952ff25ac37ae9ba03039767bf33fd51b1b039 (diff)
Huge update to the FreeBSD port (i386 part).
Starting with FreeBSD 10, the FreeBSD project has moved from using gcc/libstdc++ to using a complete C++ stack based on clang/llvm libc++ and libcxxrt. This new stack has better standards compliance and has huge similarities with MacOSX but it brought subtle low level problems for our outdated bridges code. Don Lewis has done a brave effort to update this code and has done extensive testing within FreeBSD port. Support for older versions of gcc has been dropped. Code Review: https://reviews.freebsd.org/D2108 https://reviews.freebsd.org/D2055 Author: Don Lewis (truckman at FreeBSD)
Notes
Notes: prefer: 551898cdd21f323df0222a96ff4dde3ecf38da2d
-rw-r--r--bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx5
-rw-r--r--bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx12
-rw-r--r--bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx12
-rw-r--r--bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx11
4 files changed, 33 insertions, 7 deletions
diff --git a/bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx
index 03103e6d78d2..1ad2e610085c 100644
--- a/bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx
@@ -24,6 +24,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
+#include <typeinfo>
+#include <exception>
+#include <cstddef>
+#include <cxxabi.h>
+
#include <com/sun/star/uno/genfunc.hxx>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <uno/data.h>
diff --git a/bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx b/bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx
index 307185f58a8e..525a65a3d368 100644
--- a/bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_freebsd_intel/except.cxx
@@ -24,9 +24,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
-#if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
+#include <cstddef>
#include <exception>
-#endif
+#include <typeinfo>
#include <stdio.h>
#include <string.h>
@@ -182,7 +182,12 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
char const * rttiName = symName.getStr() +4;
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr,"generated rtti for %s\n", rttiName );
+#ifndef __GLIBCXX__ /* #i124421# */
+ const OString aCUnoName = OUStringToOString( unoName, RTL_TEXTENCODING_UTF8);
+ OSL_TRACE( "TypeInfo for \"%s\" not found and cannot be generated.\n", aCUnoName.getStr());
+#endif /* __GLIBCXX__ */
#endif
+#ifdef __GLIBCXX__ /* #i124421# */
if (pTypeDescr->pBaseTypeDescription)
{
// ensure availability of base
@@ -196,6 +201,9 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
// this class has no base class
rtti = new __class_type_info( strdup( rttiName ) );
}
+#else /* __GLIBCXX__ */
+ rtti = NULL;
+#endif /* __GLIBCXX__ */
pair< t_rtti_map::iterator, bool > insertion(
m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
diff --git a/bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx b/bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx
index de9f7dd7bd9b..aaffe8610b84 100644
--- a/bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_freebsd_intel/share.hxx
@@ -23,10 +23,6 @@
#include "uno/mapping.h"
-#include <typeinfo>
-#include <exception>
-#include <cstddef>
-
namespace CPPU_CURRENT_NAMESPACE
{
@@ -34,6 +30,7 @@ void dummy_can_throw_anything( char const * );
// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
+#ifdef __GLIBCXX__
struct _Unwind_Exception
{
unsigned exception_class __attribute__((__mode__(__DI__)));
@@ -62,18 +59,21 @@ struct __cxa_exception
_Unwind_Exception unwindHeader;
};
+#endif /* __GLIBCXX__ */
extern "C" void *__cxa_allocate_exception(
std::size_t thrown_size ) throw();
extern "C" void __cxa_throw (
void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn));
+#ifdef __GLIBCXX__
struct __cxa_eh_globals
{
__cxa_exception *caughtExceptions;
unsigned int uncaughtExceptions;
};
extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
+#endif /* __GLIBCXX__ */
// -----
@@ -81,6 +81,10 @@ extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
void raiseException(
uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
//==================================================================================================
+#ifndef __GLIBCXX__
+using __cxxabiv1:: __cxa_exception;
+#endif /* __GLIBCXX__ */
+
void fillUnoException(
__cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
}
diff --git a/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx
index a3651338d982..964d4c569b54 100644
--- a/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_freebsd_intel/uno2cpp.cxx
@@ -24,6 +24,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
+#include <typeinfo>
+#include <exception>
+#include <cstddef>
+#include <cxxabi.h>
#include <stdlib.h>
#include <com/sun/star/uno/genfunc.hxx>
@@ -39,6 +43,11 @@
using namespace ::rtl;
using namespace ::com::sun::star::uno;
+#ifdef __GLIBCXX__
+using CPPU_CURRENT_NAMESPACE::__cxa_get_globals;
+#else
+using __cxxabiv1::__cxa_get_globals;
+#endif
namespace
{
@@ -305,7 +314,7 @@ static void cpp_call(
catch (...)
{
// fill uno exception
- fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
+ CPPU_CURRENT_NAMESPACE::fillUnoException( __cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
// temporary params
for ( ; nTempIndizes--; )