Author: pfg Date: Thu Mar 26 22:08:17 2015 New Revision: 1669459 URL: http://svn.apache.org/r1669459 Log: Huge update to the FreeBSD port (amd64 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) Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/cpp2uno.cxx openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/cpp2uno.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/cpp2uno.cxx?rev=1669459&r1=1669458&r2=1669459&view=diff ============================================================================== --- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/cpp2uno.cxx (original) +++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/cpp2uno.cxx Thu Mar 26 22:08:17 2015 @@ -24,9 +24,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_bridges.hxx" -#include <stdio.h> -#include <stdlib.h> -#include <hash_map> +#include <typeinfo> +#include <exception> +#include <cstddef> +#include <cxxabi.h> #include <rtl/alloc.h> #include <osl/mutex.hxx> Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx?rev=1669459&r1=1669458&r2=1669459&view=diff ============================================================================== --- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx (original) +++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/except.cxx Thu Mar 26 22:08:17 2015 @@ -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_Compo 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,7 +201,10 @@ type_info * RTTI::getRTTI( typelib_Compo // 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 ) ) ); OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx?rev=1669459&r1=1669458&r2=1669459&view=diff ============================================================================== --- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx (original) +++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/share.hxx Thu Mar 26 22:08:17 2015 @@ -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 cons // ----- 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_g 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 ); } Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx?rev=1669459&r1=1669458&r2=1669459&view=diff ============================================================================== --- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx (original) +++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/uno2cpp.cxx Thu Mar 26 22:08:17 2015 @@ -24,9 +24,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_bridges.hxx" -#include <exception> #include <typeinfo> -#include <stdio.h> +#include <exception> +#include <cstddef> +#include <cxxabi.h> #include <stdlib.h> #include <string.h> @@ -47,6 +48,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 //================================================================================================== static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, @@ -446,7 +452,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--; )
