[Libreoffice-commits] .: 6 commits - bridges/Library_gcc3_ios_arm.mk bridges/source ios/experimental sal/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Jan 19 14:20:46 PST 2013


 bridges/Library_gcc3_ios_arm.mk                          |    4 
 bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx      |  568 ++++++++++++
 bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx     |  529 +++++++++++
 bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx          |  524 -----------
 bridges/source/cpp_uno/gcc3_ios_arm/except.cxx           |   39 
 bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl |   26 
 bridges/source/cpp_uno/gcc3_ios_arm/helper.s             |    1 
 bridges/source/cpp_uno/gcc3_ios_arm/rtti.h               |  412 +++++++++
 bridges/source/cpp_uno/gcc3_ios_arm/share.hxx            |  537 -----------
 bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx      |  678 +++++++++++++++
 bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-i386.cxx     |  484 ++++++++++
 bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx          |  595 -------------
 bridges/source/cpp_uno/gcc3_ios_arm/unwind-cxx.h         |  323 +++++++
 bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx        |    2 
 ios/experimental/Viewer/Viewer/lo-viewer.mm              |    2 
 sal/inc/sal/types.h                                      |   12 
 16 files changed, 3053 insertions(+), 1683 deletions(-)

New commits:
commit 0ff470cff6ecc436e723af6a60986c8eefaba7b7
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Jan 10 01:38:57 2013 +0200

    iOS C++/UNO bridge fixes
    
    As the inline asm statement stores parameters into r0-r3 we need to
    include those registers in the clobber list. Clang happened to store
    pMethod in r2 as input to the asm snippet.
    
    iOS uses the basic calling convention, but __ARM_EABI__ is not defined
    so amend some ifdefs.
    
    Change-Id: If3d66c5f3baa4dfa13f82a2b5c2ef1ab559ce31b

diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx
index a52a80a..3a20ed8 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm.cxx
@@ -115,7 +115,7 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference *
             pRegisterReturn[0] = r0;
             break;
         case typelib_TypeClass_FLOAT:
-#if !defined(__ARM_PCS_VFP) && (defined(__ARM_EABI__) || defined(__SOFTFP__))
+#if !defined(__ARM_PCS_VFP) && (defined(__ARM_EABI__) || defined(__SOFTFP__) || defined(IOS))
             pRegisterReturn[0] = r0;
 #else
             register float fret asm("s0");
@@ -126,7 +126,7 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference *
 #endif
             break;
         case typelib_TypeClass_DOUBLE:
-#if !defined(__ARM_PCS_VFP) && (defined(__ARM_EABI__) || defined(__SOFTFP__))
+#if !defined(__ARM_PCS_VFP) && (defined(__ARM_EABI__) || defined(__SOFTFP__) || defined(IOS))
             pRegisterReturn[1] = r1;
             pRegisterReturn[0] = r0;
 #else
@@ -222,7 +222,7 @@ void callVirtualMethod(
         "mov %[r1], r1\n\t"
         : [r0]"=r" (r0), [r1]"=r" (r1)
         : [pmethod]"m" (pMethod), [pgpr]"m" (pGPR), [pfpr]"m" (pFPR)
-        : "r4", "r5");
+        : "r0", "r1", "r2", "r3", "r4", "r5");
 
     MapReturn(r0, r1, pReturnType, (sal_uInt32*)pRegisterReturn);
 }
commit 806535be2bd4e562cd11fed412185dfb6ed1d719
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Jan 10 01:38:35 2013 +0200

    Use SAL logging instead of printfs
    
    Change-Id: I6221e686fa36cd9061a2a0342a48aaadef903acf

diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
index aa66189..2441d6d 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/except.cxx
@@ -18,7 +18,6 @@
  */
 
 
-#include <stdio.h>
 #include <dlfcn.h>
 #include <cxxabi.h>
 #include <boost/unordered_map.hpp>
@@ -52,9 +51,7 @@ void dummy_can_throw_anything( char const * )
 //==================================================================================================
 static OUString toUNOname( char const * p ) SAL_THROW(())
 {
-#if OSL_DEBUG_LEVEL > 1
     char const * start = p;
-#endif
 
     // example: N3com3sun4star4lang24IllegalArgumentExceptionE
 
@@ -77,14 +74,11 @@ static OUString toUNOname( char const * p ) SAL_THROW(())
             buf.append( (sal_Unicode)'.' );
     }
 
-#if OSL_DEBUG_LEVEL > 1
-    OUString ret( buf.makeStringAndClear() );
-    OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) );
-    fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() );
-    return ret;
-#else
-    return buf.makeStringAndClear();
-#endif
+    OUString result( buf.makeStringAndClear() );
+
+    SAL_INFO( "bridges.ios", "toUNOname():" << start << " => " << result );
+
+    return result;
 }
 
 //==================================================================================================
@@ -161,9 +155,9 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
                 // symbol and rtti-name is nearly identical,
                 // the symbol is prefixed with _ZTI
                 char const * rttiName = symName.getStr() +4;
-#if OSL_DEBUG_LEVEL > 1
-                fprintf( stderr,"generated rtti for %s\n", rttiName );
-#endif
+
+                SAL_INFO( "bridges.ios", "getRTTI: generating typeinfo " << rttiName );
+
                 if (pTypeDescr->pBaseTypeDescription)
                 {
                     // ensure availability of base
@@ -216,13 +210,8 @@ static void deleteException( void * pExc )
 //==================================================================================================
 void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
 {
-#if OSL_DEBUG_LEVEL > 1
-    OString cstr(
-        OUStringToOString(
-            *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
-            RTL_TEXTENCODING_ASCII_US ) );
-    fprintf( stderr, "> uno exception occurred: %s\n", cstr.getStr() );
-#endif
+    SAL_INFO( "bridges.ios", "raiseException: " << pUnoExc->pType->pTypeName );
+
     void * pCppExc;
     type_info * rtti;
 
@@ -294,10 +283,9 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
 
     typelib_TypeDescription * pExcTypeDescr = 0;
     OUString unoName( toUNOname( header->exceptionType->name() ) );
-#if OSL_DEBUG_LEVEL > 1
-    OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) );
-    fprintf( stderr, "> c++ exception occurred: %s\n", cstr_unoName.getStr() );
-#endif
+
+    SAL_INFO( "bridges.ios", "fillUnoException: " << unoName );
+
     typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
     if (0 == pExcTypeDescr)
     {
@@ -306,6 +294,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
             Reference< XInterface >() );
         Type const & rType = ::getCppuType( &aRE );
         uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
+
 #if OSL_DEBUG_LEVEL > 0
         OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
         OSL_FAIL( cstr.getStr() );
commit 9c5bb994031f5b0951a9f47f08358ba206b38402
Author: Tor Lillqvist <tml at iki.fi>
Date:   Thu Jan 10 01:37:29 2013 +0200

    More snippets, and cosmetics
    
    Change-Id: I150981237dc642e46751f0824aeda53dbdb59e5c

diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl b/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl
index 0599170..3c33320 100755
--- a/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl
@@ -25,13 +25,13 @@
 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
 # instead of those above.
 
-my $nFunIndexes = 5;
-my $nVtableOffsets = 1;
+my $nFunIndexes = 8;
+my $nVtableOffsets = 4;
 
 sub gen_arm ($$)
 {
     my ($funIndex, $vtableOffset) = @_;
-    printf ("codeSnippet%08x%d:\n", $funIndex, $vtableOffset);
+    printf ("codeSnippet_%08x_%d:\n", $funIndex, $vtableOffset);
     printf ("\tmov ip, pc\n");
     printf ("\tb _privateSnippetExecutor\n");
     printf ("\t.long %#08x\n", $funIndex);
@@ -41,7 +41,7 @@ sub gen_arm ($$)
 sub gen_x86 ($$$)
 {
     my ($funIndex, $vtableOffset, $executor) = @_;
-    printf ("codeSnippet%08x%d%s:\n", $funIndex, $vtableOffset, $executor);
+    printf ("codeSnippet_%08x_%d_%s:\n", $funIndex, $vtableOffset, $executor);
     printf ("\tmovl \$%#08x, %%eax\n", $funIndex);
     printf ("\tmovl \$%d, %%edx\n", $vtableOffset);
     printf ("\tjmp _privateSnippetExecutor%s\n", $executor);
@@ -104,13 +104,13 @@ foreach my $funIndex (0 .. $nFunIndexes-1)
     foreach my $vtableOffset (0 .. $nVtableOffsets-1)
     {
 	printf ("#ifdef __arm\n");
-	printf ("\t.long codeSnippet%08x%d - _codeSnippets\n", $funIndex, $vtableOffset);
-	printf ("\t.long codeSnippet%08x%d - _codeSnippets\n", $funIndex|0x80000000, $vtableOffset);
+        printf ("\t.long codeSnippet_%08x_%d - _codeSnippets\n", $funIndex, $vtableOffset);
+        printf ("\t.long codeSnippet_%08x_%d - _codeSnippets\n", $funIndex|0x80000000, $vtableOffset);
 	printf ("#else\n");
 	foreach my $executor ('General', 'Void', 'Hyper', 'Float', 'Double', 'Class')
 	{
-	    printf ("\t.long codeSnippet%08x%d%s - _codeSnippets\n", $funIndex, $vtableOffset, $executor);
-	    printf ("\t.long codeSnippet%08x%d%s - _codeSnippets\n", $funIndex|0x80000000, $vtableOffset, $executor);
+            printf ("\t.long codeSnippet_%08x_%d_%s - _codeSnippets\n", $funIndex, $vtableOffset, $executor);
+            printf ("\t.long codeSnippet_%08x_%d_%s - _codeSnippets\n", $funIndex|0x80000000, $vtableOffset, $executor);
 	}
 	printf ("#endif\n");
     }
commit 5d7fad31ff1491896b4a517ce6ac652f537b7ba2
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jan 9 21:28:31 2013 +0200

    Use default visibility for exception types even when DISABLE_DYNLOADING
    
    Otherwise the dlsym() lookup of the typeinfos in the C++/UNO bridge
    won't work. And it has to, because at least for iOS on ARM the
    dynamically created typeinfos don't match those the compiler-generated
    code tries to catch, so otherwise exceptions thrown across the bridge
    don't get caught. (Fascinating, I am able to talk about this stuff as
    if I understood it.)
    
    Change-Id: Ie0d4632743e18719782f55904fb76f45c944f20c

diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index b04126a..57a1a62 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -300,11 +300,15 @@ typedef void *                   sal_Handle;
    rtl/malformeduriexception.hxx.
 */
 #if defined(__GNUC__) && ! defined(__MINGW32__)
-#define SAL_EXCEPTION_DLLPUBLIC_EXPORT SAL_DLLPUBLIC_EXPORT
-#define SAL_EXCEPTION_DLLPRIVATE SAL_DLLPRIVATE
+#   if defined(DISABLE_DYNLOADING)
+#      define SAL_EXCEPTION_DLLPUBLIC_EXPORT __attribute__((visibility("default")))
+#    else
+#      define SAL_EXCEPTION_DLLPUBLIC_EXPORT SAL_DLLPUBLIC_EXPORT
+#    endif
+#    define SAL_EXCEPTION_DLLPRIVATE SAL_DLLPRIVATE
 #else
-#define SAL_EXCEPTION_DLLPUBLIC_EXPORT
-#define SAL_EXCEPTION_DLLPRIVATE
+#    define SAL_EXCEPTION_DLLPUBLIC_EXPORT
+#    define SAL_EXCEPTION_DLLPRIVATE
 #endif
 
 /** Use this as markup for functions and methods whose return value must be
commit 9900f80d9e62cd0cd32f5203c28597496e18d690
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Jan 9 21:27:41 2013 +0200

    The UNO component file names are 'traditional' for iOS, no 'lib' prefix
    
    Change-Id: I104fde6ea294db55513ef11fe063e911e287cc31

diff --git a/ios/experimental/Viewer/Viewer/lo-viewer.mm b/ios/experimental/Viewer/Viewer/lo-viewer.mm
index 10c3156..ff543fc 100644
--- a/ios/experimental/Viewer/Viewer/lo-viewer.mm
+++ b/ios/experimental/Viewer/Viewer/lo-viewer.mm
@@ -91,7 +91,7 @@ lo_get_libmap(void)
         { "libevtattlo.a", evtatt_component_getFactory },
         { "libfileacc.a", fileacc_component_getFactory },
         { "libfrmlo.a", frm_component_getFactory },
-        { "libfsstorage.uno.a", fsstorage_component_getFactory },
+        { "fsstorage.uno.a", fsstorage_component_getFactory },
         { "libfwklo.a", fwk_component_getFactory },
         { "libfwllo.a", fwl_component_getFactory },
         { "libfwmlo.a", fwm_component_getFactory },
commit a477138dfafc877ced227201d631e512f130bce2
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Jan 8 02:19:03 2013 +0200

    Work on the iOS C++/UNO bridge
    
    Split uno2cpp.cxx and cpp2uno.cxx into separate files for the emulator
    (i386) and device (ARM). Much cleaner like that.
    
    Try harder to get the ARM stuff to actually work.
    
    Add the rtti.h and unwind-cxx.h files from libcppabi as such instead
    of cherry-picking stuff from them.
    
    Change-Id: Ia238a9ce048116ad796dfb168fd4e5d3b9712ad5

diff --git a/bridges/Library_gcc3_ios_arm.mk b/bridges/Library_gcc3_ios_arm.mk
index 6744aa4..4f5d7ff 100644
--- a/bridges/Library_gcc3_ios_arm.mk
+++ b/bridges/Library_gcc3_ios_arm.mk
@@ -55,8 +55,12 @@ $(eval $(call gb_Library_add_asmobjects,gcc3_uno,\
 
 $(eval $(call gb_Library_add_exception_objects,gcc3_uno,\
 	bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno \
+	bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm \
+	bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386 \
 	bridges/source/cpp_uno/gcc3_ios_arm/except \
 	bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp \
+	bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-arm \
+	bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp-i386 \
 	bridges/source/cpp_uno/shared/bridge \
 	bridges/source/cpp_uno/shared/component \
 	bridges/source/cpp_uno/shared/types \
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx
new file mode 100644
index 0000000..cdf0e19
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-arm.cxx
@@ -0,0 +1,568 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifdef __arm
+
+// For iOS devices (ARM). Basically a copy of n
+// ../gcc3_linux_arm/cpp2uno.cxx with some cleanups and necessary
+// changes: No dynamic code generation as that is prohibited for apps
+// in the App Store. Instead we use a set of pre-generated snippets.
+
+// No attempts at factoring out the large amounts of more or less
+// common code in this and cpp2uno-i386.cxx have been done. Which is
+// sad. But then the whole bridges/source/cpp_uno is full of
+// copy/paste. So I continue in that tradition...
+
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <uno/data.h>
+#include <typelib/typedescription.hxx>
+
+#include "bridges/cpp_uno/shared/bridge.hxx"
+#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx"
+#include "bridges/cpp_uno/shared/types.hxx"
+#include "bridges/cpp_uno/shared/vtablefactory.hxx"
+
+#include "share.hxx"
+
+extern "C" {
+    extern int nFunIndexes, nVtableOffsets;
+    extern int codeSnippets[];
+}
+
+using namespace ::com::sun::star::uno;
+
+namespace
+{
+
+    static typelib_TypeClass cpp2uno_call(
+        bridges::cpp_uno::shared::CppInterfaceProxy* pThis,
+        const typelib_TypeDescription * pMemberTypeDescr,
+        typelib_TypeDescriptionReference * pReturnTypeRef,
+        sal_Int32 nParams, typelib_MethodParameter * pParams,
+        void ** pCallStack,
+        sal_Int64 * pRegisterReturn /* space for register return */ )
+    {
+        // pCallStack: ret, [return ptr], this, params
+        char * pTopStack = (char *)(pCallStack + 0);
+        char * pCppStack = pTopStack;
+
+#ifdef __ARM_PCS_VFP
+        int dc = 0;
+        char * pFloatArgs = (char *)(pCppStack - 64);
+#endif
+        // return
+        typelib_TypeDescription * pReturnTypeDescr = 0;
+        if (pReturnTypeRef)
+            TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+
+        void * pUnoReturn = 0;
+        // complex return ptr: if != 0 && != pUnoReturn, reconversion need
+        void * pCppReturn = 0;
+
+        if (pReturnTypeDescr)
+        {
+            if (!arm::return_in_hidden_param(pReturnTypeRef))
+                pUnoReturn = pRegisterReturn; // direct way for simple types
+            else // complex return via ptr (pCppReturn)
+            {
+                pCppReturn = *(void **)pCppStack;
+                pCppStack += sizeof(void *);
+
+                pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType(
+                    pReturnTypeDescr )
+                        ? alloca( pReturnTypeDescr->nSize )
+                        : pCppReturn); // direct way
+            }
+        }
+        // pop this
+        pCppStack += sizeof( void* );
+
+        // stack space
+        OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32),
+            "### unexpected size!" );
+        // parameters
+        void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
+        void ** pCppArgs = pUnoArgs + nParams;
+        // indizes of values this have to be converted (interface conversion
+        // cpp<=>uno)
+        sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+        // type descriptions for reconversions
+        typelib_TypeDescription ** ppTempParamTypeDescr =
+            (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
+
+        sal_Int32 nTempIndizes   = 0;
+
+        for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
+        {
+            const typelib_MethodParameter & rParam = pParams[nPos];
+            typelib_TypeDescription * pParamTypeDescr = 0;
+            TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+            if (!rParam.bOut &&
+                bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+            {
+#ifdef __ARM_EABI__
+                switch (pParamTypeDescr->eTypeClass)
+                {
+                    case typelib_TypeClass_HYPER:
+                    case typelib_TypeClass_UNSIGNED_HYPER:
+#ifndef __ARM_PCS_VFP
+                    case typelib_TypeClass_DOUBLE:
+#endif
+                        if ((pCppStack - pTopStack) % 8) pCppStack+=sizeof(sal_Int32); //align to 8
+                        break;
+                    default:
+                        break;
+                }
+#endif
+
+// For armhf we get the floating point arguments from a different area of the stack
+#ifdef __ARM_PCS_VFP
+                if (pParamTypeDescr->eTypeClass == typelib_TypeClass_FLOAT)
+                {
+                    pCppArgs[nPos] =  pUnoArgs[nPos] = pFloatArgs;
+                    pFloatArgs += sizeof(float);
+                } else
+                if (pParamTypeDescr->eTypeClass == typelib_TypeClass_DOUBLE)
+                {
+                    if ((pFloatArgs - pTopStack) % 8) pFloatArgs+=sizeof(float); //align to 8
+                    pCppArgs[nPos] = pUnoArgs[nPos] = pFloatArgs;
+                    pFloatArgs += sizeof(double);
+                    if (++dc == arm::MAX_FPR_REGS) {
+                        if (pCppStack - pTopStack < 16)
+                            pCppStack = pTopStack + 16;
+                        pFloatArgs = pCppStack;
+                    }
+                } else
+#endif
+                    pCppArgs[nPos] = pUnoArgs[nPos] = pCppStack;
+
+                switch (pParamTypeDescr->eTypeClass)
+                {
+                    case typelib_TypeClass_HYPER:
+                    case typelib_TypeClass_UNSIGNED_HYPER:
+#ifndef __ARM_PCS_VFP
+                    case typelib_TypeClass_DOUBLE:
+#endif
+                        pCppStack += sizeof(sal_Int32); // extra long
+                        break;
+                    default:
+                        break;
+                }
+                // no longer needed
+                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+            }
+            else // ptr to complex value | ref
+            {
+                pCppArgs[nPos] = *(void **)pCppStack;
+
+                if (! rParam.bIn) // is pure out
+                {
+                    // uno out is unconstructed mem!
+                    pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
+                    pTempIndizes[nTempIndizes] = nPos;
+                    // will be released at reconversion
+                    ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+                }
+                // is in/inout
+                else if (bridges::cpp_uno::shared::relatesToInterfaceType(
+                    pParamTypeDescr ))
+                {
+                    uno_copyAndConvertData( pUnoArgs[nPos] =
+                        alloca( pParamTypeDescr->nSize ),
+                        *(void **)pCppStack, pParamTypeDescr,
+                        pThis->getBridge()->getCpp2Uno() );
+                    pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+                    // will be released at reconversion
+                    ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+                }
+                else // direct way
+                {
+                    pUnoArgs[nPos] = *(void **)pCppStack;
+                    // no longer needed
+                    TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+                }
+            }
+#ifdef __ARM_PCS_VFP
+            // use the stack for output parameters or non floating point values
+                if (rParam.bOut ||
+                        ((pParamTypeDescr->eTypeClass != typelib_TypeClass_DOUBLE)
+                         && (pParamTypeDescr->eTypeClass != typelib_TypeClass_FLOAT))
+                    )
+#endif
+            pCppStack += sizeof(sal_Int32); // standard parameter length
+        }
+
+        // ExceptionHolder
+        uno_Any aUnoExc; // Any will be constructed by callee
+        uno_Any * pUnoExc = &aUnoExc;
+
+        // invoke uno dispatch call
+        (*pThis->getUnoI()->pDispatcher)(
+          pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
+
+        // in case an exception occurred...
+        if (pUnoExc)
+        {
+            // destruct temporary in/inout params
+            for ( ; nTempIndizes--; )
+            {
+                sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+
+                if (pParams[nIndex].bIn) // is in/inout => was constructed
+                    uno_destructData( pUnoArgs[nIndex],
+                        ppTempParamTypeDescr[nTempIndizes], 0 );
+                TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+            }
+            if (pReturnTypeDescr)
+                TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+
+            CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc,
+                pThis->getBridge()->getUno2Cpp() ); // has to destruct the any
+            // is here for dummy
+            return typelib_TypeClass_VOID;
+        }
+        else // else no exception occurred...
+        {
+            // temporary params
+            for ( ; nTempIndizes--; )
+            {
+                sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+                typelib_TypeDescription * pParamTypeDescr =
+                    ppTempParamTypeDescr[nTempIndizes];
+
+                if (pParams[nIndex].bOut) // inout/out
+                {
+                    // convert and assign
+                    uno_destructData( pCppArgs[nIndex], pParamTypeDescr,
+                        cpp_release );
+                    uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex],
+                        pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+                }
+                // destroy temp uno param
+                uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
+
+                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+            }
+            // return
+            if (pCppReturn) // has complex return
+            {
+                if (pUnoReturn != pCppReturn) // needs reconversion
+                {
+                    uno_copyAndConvertData( pCppReturn, pUnoReturn,
+                        pReturnTypeDescr, pThis->getBridge()->getUno2Cpp() );
+                    // destroy temp uno return
+                    uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
+                }
+                // complex return ptr is set to eax
+                *(void **)pRegisterReturn = pCppReturn;
+            }
+            if (pReturnTypeDescr)
+            {
+                typelib_TypeClass eRet =
+                    (typelib_TypeClass)pReturnTypeDescr->eTypeClass;
+                TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+                return eRet;
+            }
+            else
+                return typelib_TypeClass_VOID;
+        }
+    }
+
+
+    //=====================================================================
+    static typelib_TypeClass cpp_mediate(
+        sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
+        void ** pCallStack,
+        sal_Int64 * pRegisterReturn /* space for register return */ )
+    {
+        OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
+
+        // pCallStack: [ret *], this, params
+        // _this_ ptr is patched cppu_XInterfaceProxy object
+        void *pThis;
+        if( nFunctionIndex & 0x80000000 )
+        {
+            nFunctionIndex &= 0x7fffffff;
+            pThis = pCallStack[1];
+        }
+        else
+        {
+            pThis = pCallStack[0];
+        }
+
+        pThis = static_cast< char * >(pThis) - nVtableOffset;
+        bridges::cpp_uno::shared::CppInterfaceProxy * pCppI =
+            bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
+                pThis);
+
+        typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
+
+        OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex,
+            "### illegal vtable index!" );
+        if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
+        {
+            throw RuntimeException( "illegal vtable index!", (XInterface *)pCppI );
+        }
+
+        // determine called method
+        OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex,
+            "### illegal vtable index!" );
+        sal_Int32 nMemberPos =
+            pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
+        OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers,
+            "### illegal member index!" );
+
+        TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
+
+        typelib_TypeClass eRet;
+        switch (aMemberDescr.get()->eTypeClass)
+        {
+        case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+        {
+            if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] ==
+                nFunctionIndex)
+            {
+                // is GET method
+                eRet = cpp2uno_call(
+                    pCppI, aMemberDescr.get(),
+                    ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
+                    0, 0, // no params
+                    pCallStack, pRegisterReturn );
+            }
+            else
+            {
+                // is SET method
+                typelib_MethodParameter aParam;
+                aParam.pTypeRef =
+                    ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
+                aParam.bIn      = sal_True;
+                aParam.bOut     = sal_False;
+
+                eRet = cpp2uno_call(
+                    pCppI, aMemberDescr.get(),
+                    0, // indicates void return
+                    1, &aParam,
+                    pCallStack, pRegisterReturn );
+            }
+            break;
+        }
+        case typelib_TypeClass_INTERFACE_METHOD:
+        {
+            // is METHOD
+            switch (nFunctionIndex)
+            {
+            case 1: // acquire()
+                pCppI->acquireProxy(); // non virtual call!
+                eRet = typelib_TypeClass_VOID;
+                break;
+            case 2: // release()
+                pCppI->releaseProxy(); // non virtual call!
+                eRet = typelib_TypeClass_VOID;
+                break;
+            case 0: // queryInterface() opt
+            {
+                typelib_TypeDescription * pTD = 0;
+                TYPELIB_DANGER_GET(&pTD,
+                    reinterpret_cast<Type *>(pCallStack[2])->getTypeLibType());
+                if (pTD)
+                {
+                    XInterface * pInterface = 0;
+                    (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
+                        pCppI->getBridge()->getCppEnv(),
+                        (void **)&pInterface, pCppI->getOid().pData,
+                        (typelib_InterfaceTypeDescription *)pTD );
+
+                    if (pInterface)
+                    {
+                        ::uno_any_construct(
+                            reinterpret_cast< uno_Any * >( pCallStack[0] ),
+                            &pInterface, pTD, cpp_acquire );
+                        pInterface->release();
+                        TYPELIB_DANGER_RELEASE( pTD );
+                        *(void **)pRegisterReturn = pCallStack[0];
+                        eRet = typelib_TypeClass_ANY;
+                        break;
+                    }
+                    TYPELIB_DANGER_RELEASE( pTD );
+                }
+            } // else perform queryInterface()
+            default:
+                eRet = cpp2uno_call(
+                    pCppI, aMemberDescr.get(),
+                    ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
+                    ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
+                    ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
+                    pCallStack, pRegisterReturn );
+            }
+            break;
+        }
+        default:
+        {
+            throw RuntimeException( "no member description found!", (XInterface *)pCppI );
+        }
+        }
+
+        return eRet;
+    }
+}
+
+//=======================================================================
+/**
+ * is called on incoming vtable calls
+ * (called by asm snippets)
+ */
+
+extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset,
+    void **pCallStack )
+{
+    sal_Int64 nRegReturn;
+    typelib_TypeClass aType = cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack,
+        &nRegReturn );
+
+    switch( aType )
+    {
+        case typelib_TypeClass_BOOLEAN:
+        case typelib_TypeClass_BYTE:
+            nRegReturn = (unsigned long)(*(unsigned char *)&nRegReturn);
+            break;
+        case typelib_TypeClass_CHAR:
+        case typelib_TypeClass_UNSIGNED_SHORT:
+        case typelib_TypeClass_SHORT:
+            nRegReturn = (unsigned long)(*(unsigned short *)&nRegReturn);
+            break;
+        case typelib_TypeClass_ENUM:
+        case typelib_TypeClass_UNSIGNED_LONG:
+        case typelib_TypeClass_LONG:
+            nRegReturn = (unsigned long)(*(unsigned int *)&nRegReturn);
+            break;
+        case typelib_TypeClass_VOID:
+        default:
+            break;
+    }
+
+    return nRegReturn;
+}
+
+namespace
+{
+    unsigned char *codeSnippet(sal_Int32 functionIndex,
+        sal_Int32 vtableOffset, bool bHasHiddenParam)
+    {
+        assert(functionIndex < nFunIndexes);
+        if (!(functionIndex < nFunIndexes))
+            return NULL;
+
+        assert(vtableOffset < nVtableOffsets);
+        if (!(vtableOffset < nVtableOffsets))
+            return NULL;
+
+        // The codeSnippets table is indexed by functionIndex,
+        // vtableOffset, and the has-hidden-param flag
+
+        int index = functionIndex*nVtableOffsets*2 + vtableOffset*2 + bHasHiddenParam;
+        unsigned char *result = ((unsigned char *) &codeSnippets) + codeSnippets[index];
+
+        SAL_INFO( "bridges.ios",
+                  "codeSnippet: [" <<
+                  functionIndex << "," << vtableOffset << "," << bHasHiddenParam << "]=" <<
+                  (void *) result);
+
+        return result;
+    }
+}
+
+struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
+{
+    return static_cast< Slot * >(block) + 2;
+}
+
+sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
+    sal_Int32 slotCount)
+{
+    return (slotCount + 2) * sizeof (Slot);
+}
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::initializeBlock(
+    void * block, sal_Int32 slotCount)
+{
+    Slot * slots = mapBlockToVtable(block);
+    slots[-2].fn = 0;
+    slots[-1].fn = 0;
+    return slots + slotCount;
+}
+
+unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
+    Slot ** slots, unsigned char * code,
+    typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
+    sal_Int32 functionCount, sal_Int32 vtableOffset)
+{
+    (*slots) -= functionCount;
+    Slot * s = *slots;
+    for (sal_Int32 i = 0; i < type->nMembers; ++i)
+    {
+        typelib_TypeDescription * member = 0;
+        TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
+        OSL_ASSERT(member != 0);
+        switch (member->eTypeClass)
+        {
+            case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+            {
+                typelib_InterfaceAttributeTypeDescription *pAttrTD =
+                    reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( member );
+
+                // Getter:
+                (s++)->fn = codeSnippet(
+                    functionOffset++, vtableOffset,
+                    arm::return_in_hidden_param( pAttrTD->pAttributeTypeRef ));
+
+                // Setter:
+                if (!pAttrTD->bReadOnly)
+                {
+                    (s++)->fn = codeSnippet(
+                        functionOffset++, vtableOffset, false);
+                }
+                break;
+            }
+            case typelib_TypeClass_INTERFACE_METHOD:
+            {
+                typelib_InterfaceMethodTypeDescription *pMethodTD =
+                    reinterpret_cast<
+                        typelib_InterfaceMethodTypeDescription * >(member);
+
+                (s++)->fn = codeSnippet(functionOffset++, vtableOffset,
+                    arm::return_in_hidden_param(pMethodTD->pReturnTypeRef));
+                break;
+            }
+        default:
+            OSL_ASSERT(false);
+            break;
+        }
+        TYPELIB_DANGER_RELEASE(member);
+    }
+    return code;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx
new file mode 100644
index 0000000..1c9bfab
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno-i386.cxx
@@ -0,0 +1,529 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifdef __i386
+
+// For the iOS emulator (i386). Basically a copy of
+// ../gcc3_macosx_intel/cpp2uno.cxx with some cleanups and necessary
+// changes: To match what we do on iOS devices, we don't do any
+// dynamic code generation on the emulator either (even if it as such
+// wouldn't be prohibited).
+
+// No attempts at factoring out the large amounts of more or less
+// common code in this and cpp2uno-arm.cxx have been done. Which is
+// sad. But then the whole bridges/source/cpp_uno is full of
+// copy/paste. So I continue in that tradition...
+
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <uno/data.h>
+#include <typelib/typedescription.hxx>
+
+#include "bridges/cpp_uno/shared/bridge.hxx"
+#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx"
+#include "bridges/cpp_uno/shared/types.hxx"
+#include "bridges/cpp_uno/shared/vtablefactory.hxx"
+
+#include "share.hxx"
+
+extern "C" {
+    extern int nFunIndexes, nVtableOffsets;
+    extern int codeSnippets[];
+}
+
+using namespace ::com::sun::star::uno;
+
+namespace
+{
+
+//==================================================================================================
+void cpp2uno_call(
+    bridges::cpp_uno::shared::CppInterfaceProxy * pThis,
+    const typelib_TypeDescription * pMemberTypeDescr,
+    typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return
+    sal_Int32 nParams, typelib_MethodParameter * pParams,
+    void ** pCallStack,
+    void * pReturnValue )
+{
+    // pCallStack: ret, [return ptr], this, params
+    char * pCppStack = (char *)(pCallStack +1);
+
+    // return
+    typelib_TypeDescription * pReturnTypeDescr = 0;
+    if (pReturnTypeRef)
+        TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+
+    void * pUnoReturn = 0;
+    void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need
+
+    if (pReturnTypeDescr)
+    {
+        // xxx todo: test PolyStructy<STRUCT<long>> foo()
+        if (CPPU_CURRENT_NAMESPACE::isSimpleReturnType( pReturnTypeDescr ))
+        {
+            pUnoReturn = pReturnValue; // direct way for simple types
+        }
+        else // complex return via ptr (pCppReturn)
+        {
+            pCppReturn = *(void **)pCppStack;
+            pCppStack += sizeof(void *);
+            pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType(
+                              pReturnTypeDescr )
+                          ? alloca( pReturnTypeDescr->nSize )
+                          : pCppReturn); // direct way
+        }
+    }
+    // pop this
+    pCppStack += sizeof( void* );
+
+    // stack space
+    OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+    // parameters
+    void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
+    void ** pCppArgs = pUnoArgs + nParams;
+    // indizes of values this have to be converted (interface conversion cpp<=>uno)
+    sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+    // type descriptions for reconversions
+    typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
+
+    sal_Int32 nTempIndizes   = 0;
+
+    for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
+    {
+        const typelib_MethodParameter & rParam = pParams[nPos];
+        typelib_TypeDescription * pParamTypeDescr = 0;
+        TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+        if (!rParam.bOut
+            && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+            // value
+        {
+            pCppArgs[nPos] = pCppStack;
+            pUnoArgs[nPos] = pCppStack;
+            switch (pParamTypeDescr->eTypeClass)
+            {
+            case typelib_TypeClass_HYPER:
+            case typelib_TypeClass_UNSIGNED_HYPER:
+            case typelib_TypeClass_DOUBLE:
+                pCppStack += sizeof(sal_Int32); // extra long
+            default:
+                break;
+            }
+            // no longer needed
+            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+        }
+        else // ptr to complex value | ref
+        {
+            pCppArgs[nPos] = *(void **)pCppStack;
+
+            if (! rParam.bIn) // is pure out
+            {
+                // uno out is unconstructed mem!
+                pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
+                pTempIndizes[nTempIndizes] = nPos;
+                // will be released at reconversion
+                ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+            }
+            // is in/inout
+            else if (bridges::cpp_uno::shared::relatesToInterfaceType(
+                         pParamTypeDescr ))
+            {
+                uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+                                        *(void **)pCppStack, pParamTypeDescr,
+                                        pThis->getBridge()->getCpp2Uno() );
+                pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+                // will be released at reconversion
+                ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+            }
+            else // direct way
+            {
+                pUnoArgs[nPos] = *(void **)pCppStack;
+                // no longer needed
+                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+            }
+        }
+        pCppStack += sizeof(sal_Int32); // standard parameter length
+    }
+
+    // ExceptionHolder
+    uno_Any aUnoExc; // Any will be constructed by callee
+    uno_Any * pUnoExc = &aUnoExc;
+
+    // invoke uno dispatch call
+    (*pThis->getUnoI()->pDispatcher)(
+        pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
+
+    // in case an exception occurred...
+    if (pUnoExc)
+    {
+        // destruct temporary in/inout params
+        for ( ; nTempIndizes--; )
+        {
+            sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+
+            if (pParams[nIndex].bIn) // is in/inout => was constructed
+                uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 );
+            TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+        }
+        if (pReturnTypeDescr)
+            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+
+        CPPU_CURRENT_NAMESPACE::raiseException(
+            &aUnoExc, pThis->getBridge()->getUno2Cpp() );
+            // has to destruct the any
+    }
+    else // else no exception occurred...
+    {
+        // temporary params
+        for ( ; nTempIndizes--; )
+        {
+            sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+            typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes];
+
+            if (pParams[nIndex].bOut) // inout/out
+            {
+                // convert and assign
+                uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
+                uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr,
+                                        pThis->getBridge()->getUno2Cpp() );
+            }
+            // destroy temp uno param
+            uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
+
+            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+        }
+        // return
+        if (pCppReturn) // has complex return
+        {
+            if (pUnoReturn != pCppReturn) // needs reconversion
+            {
+                uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr,
+                                        pThis->getBridge()->getUno2Cpp() );
+                // destroy temp uno return
+                uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
+            }
+            if (pReturnValue != pCppReturn) {
+                // complex return ptr is set to eax if return value
+                // is not transferred via eax[/edx]:
+                *static_cast< void ** >(pReturnValue) = pCppReturn;
+            }
+        }
+        if (pReturnTypeDescr)
+        {
+            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+        }
+    }
+}
+
+
+//==================================================================================================
+extern "C" void cpp_vtable_call(
+    int nFunctionIndex, int nVtableOffset, void** pCallStack,
+    void * pReturnValue )
+{
+    OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
+
+    // pCallStack: ret adr, [ret *], this, params
+    void * pThis;
+    if( nFunctionIndex & 0x80000000 )
+    {
+        nFunctionIndex &= 0x7fffffff;
+        pThis = pCallStack[2];
+    }
+    else
+    {
+        pThis = pCallStack[1];
+    }
+    pThis = static_cast< char * >(pThis) - nVtableOffset;
+    bridges::cpp_uno::shared::CppInterfaceProxy * pCppI
+        = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
+            pThis);
+
+    typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
+
+    SAL_INFO( "bridges.ios", "cpp_vtable_call: pCallStack=[" <<
+              std::hex << pCallStack[0] << "," << pCallStack[1] << "," << pCallStack[2] << ",...]" <<
+              ", pThis=" << pThis << ", pCppI=" << pCppI <<
+              std::dec << ", nFunctionIndex=" << nFunctionIndex << ", nVtableOffset=" << nVtableOffset );
+
+    SAL_INFO( "bridges.ios", "name=" << pTypeDescr->aBase.pTypeName );
+
+    assert( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex );
+
+    if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
+    {
+        throw RuntimeException( "illegal vtable index!", (XInterface *)pThis );
+    }
+
+    // determine called method
+    sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
+
+    assert( nMemberPos < pTypeDescr->nAllMembers );
+
+    TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
+
+    SAL_INFO( "bridges.ios", "Calling " << aMemberDescr.get()->pTypeName );
+
+    switch (aMemberDescr.get()->eTypeClass)
+    {
+    case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+    {
+        if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex)
+        {
+            // is GET method
+            cpp2uno_call(
+                pCppI, aMemberDescr.get(),
+                ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
+                0, 0, // no params
+                pCallStack, pReturnValue );
+        }
+        else
+        {
+            // is SET method
+            typelib_MethodParameter aParam;
+            aParam.pTypeRef =
+                ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
+            aParam.bIn      = sal_True;
+            aParam.bOut     = sal_False;
+
+            cpp2uno_call(
+                pCppI, aMemberDescr.get(),
+                0, // indicates void return
+                1, &aParam,
+                pCallStack, pReturnValue );
+        }
+        break;
+    }
+    case typelib_TypeClass_INTERFACE_METHOD:
+    {
+        // is METHOD
+        switch (nFunctionIndex)
+        {
+        case 1: // acquire()
+            pCppI->acquireProxy(); // non virtual call!
+            break;
+        case 2: // release()
+            pCppI->releaseProxy(); // non virtual call!
+            break;
+        case 0: // queryInterface() opt
+        {
+            typelib_TypeDescription * pTD = 0;
+            TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pCallStack[3] )->getTypeLibType() );
+            if (pTD)
+            {
+                XInterface * pInterface = 0;
+                (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
+                    pCppI->getBridge()->getCppEnv(),
+                    (void **)&pInterface, pCppI->getOid().pData,
+                    (typelib_InterfaceTypeDescription *)pTD );
+
+                if (pInterface)
+                {
+                    ::uno_any_construct(
+                        reinterpret_cast< uno_Any * >( pCallStack[1] ),
+                        &pInterface, pTD, cpp_acquire );
+                    pInterface->release();
+                    TYPELIB_DANGER_RELEASE( pTD );
+                    *static_cast< void ** >(pReturnValue) = pCallStack[1];
+                    break;
+                }
+                TYPELIB_DANGER_RELEASE( pTD );
+            }
+        } // else perform queryInterface()
+        default:
+            cpp2uno_call(
+                pCppI, aMemberDescr.get(),
+                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
+                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
+                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
+                pCallStack, pReturnValue );
+        }
+        break;
+    }
+    default:
+    {
+        throw RuntimeException( "no member description found!", (XInterface *)pThis );
+    }
+    }
+}
+
+typedef enum { privateSnippetExecutorGeneral, privateSnippetExecutorVoid, privateSnippetExecutorHyper, privateSnippetExecutorFloat, privateSnippetExecutorDouble, privateSnippetExecutorClass } snippetExecutorKind;
+
+static const char * snippetExecutorClassName(
+    snippetExecutorKind exec)
+{
+    switch (exec) {
+    case privateSnippetExecutorGeneral: return "General";
+    case privateSnippetExecutorVoid: return "Void";
+    case privateSnippetExecutorHyper: return "Hyper";
+    case privateSnippetExecutorFloat: return "Float";
+    case privateSnippetExecutorDouble: return "Double";
+    case privateSnippetExecutorClass: return "Class";
+    default:
+        abort();
+    }
+}
+
+unsigned char * codeSnippet(
+    sal_Int32 functionIndex, sal_Int32 vtableOffset,
+    typelib_TypeDescriptionReference * pReturnTypeRef)
+{
+    assert(functionIndex < nFunIndexes);
+    if (!(functionIndex < nFunIndexes))
+        return NULL;
+
+    assert(vtableOffset < nVtableOffsets);
+    if (!(vtableOffset < nVtableOffsets))
+        return NULL;
+
+    snippetExecutorKind exec;
+    bool bHasHiddenParam = false;
+    if (pReturnTypeRef == 0) {
+        exec = privateSnippetExecutorVoid;
+    }
+    else {
+        switch (pReturnTypeRef->eTypeClass) {
+        case typelib_TypeClass_VOID:
+            exec = privateSnippetExecutorVoid;
+            break;
+        case typelib_TypeClass_HYPER:
+        case typelib_TypeClass_UNSIGNED_HYPER:
+            exec = privateSnippetExecutorHyper;
+            break;
+        case typelib_TypeClass_FLOAT:
+            exec = privateSnippetExecutorFloat;
+            break;
+        case typelib_TypeClass_DOUBLE:
+            exec = privateSnippetExecutorDouble;
+            break;
+        case typelib_TypeClass_STRUCT:
+        case typelib_TypeClass_EXCEPTION: {
+            typelib_TypeDescription * pReturnTypeDescr = 0;
+            TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+            bool const bSimpleReturnStruct =
+                CPPU_CURRENT_NAMESPACE::isSimpleReturnType(pReturnTypeDescr);
+            sal_Int32 const nRetSize = pReturnTypeDescr->nSize;
+            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+            if (bSimpleReturnStruct && nRetSize <= 8) {
+                exec = privateSnippetExecutorGeneral; // fills eax
+                if (nRetSize > 4)
+                    exec = privateSnippetExecutorHyper; // fills eax/edx
+                break;
+            }
+        }
+        case typelib_TypeClass_STRING:
+        case typelib_TypeClass_TYPE:
+        case typelib_TypeClass_SEQUENCE:
+        case typelib_TypeClass_INTERFACE:
+        case typelib_TypeClass_ANY:
+            bHasHiddenParam = 1;
+            exec = privateSnippetExecutorClass;
+            break;
+        default:
+            exec = privateSnippetExecutorGeneral;
+            break;
+        }
+    }
+
+    // The codeSnippets table is indexed by functionIndex,
+    // vtableOffset, exec and the has-hidden-param flag
+
+    int index = functionIndex*nVtableOffsets*6*2 + vtableOffset*6*2 + exec*2 + bHasHiddenParam;
+    unsigned char *result = ((unsigned char *) &codeSnippets) + codeSnippets[index];
+
+    SAL_INFO( "bridges.ios", "codeSnippet: [" <<
+              functionIndex << "," << vtableOffset << "," << snippetExecutorClassName(exec) << "," << bHasHiddenParam << "]=" <<
+              (void *) result);
+
+    return result;
+}
+
+}
+
+struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
+{
+    return static_cast< Slot * >(block) + 2;
+}
+
+sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
+    sal_Int32 slotCount)
+{
+    return (slotCount + 2) * sizeof (Slot);
+}
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::initializeBlock(
+    void * block, sal_Int32 slotCount)
+{
+    Slot * slots = mapBlockToVtable(block);
+    slots[-2].fn = 0;
+    slots[-1].fn = 0;
+    return slots + slotCount;
+}
+
+unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
+    Slot ** slots, unsigned char * code,
+    typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
+    sal_Int32 functionCount, sal_Int32 vtableOffset)
+{
+    (*slots) -= functionCount;
+    Slot * s = *slots;
+    for (sal_Int32 i = 0; i < type->nMembers; ++i) {
+        typelib_TypeDescription * member = 0;
+        TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
+        OSL_ASSERT(member != 0);
+        switch (member->eTypeClass) {
+        case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+            // Getter:
+            (s++)->fn = codeSnippet(
+                functionOffset++, vtableOffset,
+                reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
+                    member)->pAttributeTypeRef);
+            // Setter:
+            if (!reinterpret_cast<
+                typelib_InterfaceAttributeTypeDescription * >(
+                    member)->bReadOnly)
+            {
+                (s++)->fn = codeSnippet(
+                    functionOffset++, vtableOffset,
+                    0 /* indicates VOID */);
+            }
+            break;
+
+        case typelib_TypeClass_INTERFACE_METHOD:
+            (s++)->fn = codeSnippet(
+                functionOffset++, vtableOffset,
+                reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
+                    member)->pReturnTypeRef);
+            break;
+
+        default:
+            OSL_ASSERT(false);
+            break;
+        }
+        TYPELIB_DANGER_RELEASE(member);
+    }
+    return code;
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx
index 0cc87fa..5fc6d62 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/cpp2uno.cxx
@@ -17,533 +17,15 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+// If we eventually get around to factoring out stuff from
+// cpp2uno-arm.cxx and cpp2uno-i386.cxx here, this is where to put it.
 
-#include <com/sun/star/uno/genfunc.hxx>
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/Sequence.hxx"
-#include <uno/data.h>
-#include <typelib/typedescription.hxx>
-
-#include "bridges/cpp_uno/shared/bridge.hxx"
-#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx"
-#include "bridges/cpp_uno/shared/types.hxx"
 #include "bridges/cpp_uno/shared/vtablefactory.hxx"
 
-#include "share.hxx"
-
-#include "boost/static_assert.hpp"
-#include <stdio.h>
-
-using namespace ::com::sun::star::uno;
-
-namespace
-{
-
-//==================================================================================================
-void cpp2uno_call(
-    bridges::cpp_uno::shared::CppInterfaceProxy * pThis,
-    const typelib_TypeDescription * pMemberTypeDescr,
-    typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return
-    sal_Int32 nParams, typelib_MethodParameter * pParams,
-    void ** pCallStack,
-    void * pReturnValue )
-{
-    // pCallStack: ret, [return ptr], this, params
-    char * pCppStack = (char *)(pCallStack +1);
-
-    // return
-    typelib_TypeDescription * pReturnTypeDescr = 0;
-    if (pReturnTypeRef)
-        TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
-
-    void * pUnoReturn = 0;
-    void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need
-
-    if (pReturnTypeDescr)
-    {
-        // xxx todo: test PolyStructy<STRUCT<long>> foo()
-        if (
-#ifdef __arm
-            !arm::return_in_hidden_param(pReturnTypeRef)
-#else
-            CPPU_CURRENT_NAMESPACE::isSimpleReturnType( pReturnTypeDescr )
-#endif
-            )
-        {
-            pUnoReturn = pReturnValue; // direct way for simple types
-        }
-        else // complex return via ptr (pCppReturn)
-        {
-            pCppReturn = *(void **)pCppStack;
-            pCppStack += sizeof(void *);
-            pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType(
-                              pReturnTypeDescr )
-                          ? alloca( pReturnTypeDescr->nSize )
-                          : pCppReturn); // direct way
-        }
-    }
-    // pop this
-    pCppStack += sizeof( void* );
-
-    // stack space
-    OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
-    // parameters
-    void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
-    void ** pCppArgs = pUnoArgs + nParams;
-    // indizes of values this have to be converted (interface conversion cpp<=>uno)
-    sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams));
-    // type descriptions for reconversions
-    typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
-
-    sal_Int32 nTempIndizes   = 0;
-
-    for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
-    {
-        const typelib_MethodParameter & rParam = pParams[nPos];
-        typelib_TypeDescription * pParamTypeDescr = 0;
-        TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
-
-        if (!rParam.bOut
-            && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
-            // value
-        {
-            pCppArgs[nPos] = pCppStack;
-            pUnoArgs[nPos] = pCppStack;
-            switch (pParamTypeDescr->eTypeClass)
-            {
-            case typelib_TypeClass_HYPER:
-            case typelib_TypeClass_UNSIGNED_HYPER:
-            case typelib_TypeClass_DOUBLE:
-                pCppStack += sizeof(sal_Int32); // extra long
-            default:
-                break;
-            }
-            // no longer needed
-            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
-        }
-        else // ptr to complex value | ref
-        {
-            pCppArgs[nPos] = *(void **)pCppStack;
-
-            if (! rParam.bIn) // is pure out
-            {
-                // uno out is unconstructed mem!
-                pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
-                pTempIndizes[nTempIndizes] = nPos;
-                // will be released at reconversion
-                ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
-            }
-            // is in/inout
-            else if (bridges::cpp_uno::shared::relatesToInterfaceType(
-                         pParamTypeDescr ))
-            {
-                uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
-                                        *(void **)pCppStack, pParamTypeDescr,
-                                        pThis->getBridge()->getCpp2Uno() );
-                pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
-                // will be released at reconversion
-                ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
-            }
-            else // direct way
-            {
-                pUnoArgs[nPos] = *(void **)pCppStack;
-                // no longer needed
-                TYPELIB_DANGER_RELEASE( pParamTypeDescr );
-            }
-        }
-        pCppStack += sizeof(sal_Int32); // standard parameter length
-    }
-
-    // ExceptionHolder
-    uno_Any aUnoExc; // Any will be constructed by callee
-    uno_Any * pUnoExc = &aUnoExc;
-
-    // invoke uno dispatch call
-    (*pThis->getUnoI()->pDispatcher)(
-        pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
-
-    // in case an exception occurred...
-    if (pUnoExc)
-    {
-        // destruct temporary in/inout params
-        for ( ; nTempIndizes--; )
-        {
-            sal_Int32 nIndex = pTempIndizes[nTempIndizes];
-
-            if (pParams[nIndex].bIn) // is in/inout => was constructed
-                uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 );
-            TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
-        }
-        if (pReturnTypeDescr)
-            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
-
-        CPPU_CURRENT_NAMESPACE::raiseException(
-            &aUnoExc, pThis->getBridge()->getUno2Cpp() );
-            // has to destruct the any
-    }
-    else // else no exception occurred...
-    {
-        // temporary params
-        for ( ; nTempIndizes--; )
-        {
-            sal_Int32 nIndex = pTempIndizes[nTempIndizes];
-            typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes];
-
-            if (pParams[nIndex].bOut) // inout/out
-            {
-                // convert and assign
-                uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
-                uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr,
-                                        pThis->getBridge()->getUno2Cpp() );
-            }
-            // destroy temp uno param
-            uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
-
-            TYPELIB_DANGER_RELEASE( pParamTypeDescr );
-        }
-        // return
-        if (pCppReturn) // has complex return
-        {
-            if (pUnoReturn != pCppReturn) // needs reconversion
-            {
-                uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr,
-                                        pThis->getBridge()->getUno2Cpp() );
-                // destroy temp uno return
-                uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
-            }
-            if (pReturnValue != pCppReturn) {
-                // complex return ptr is set to eax if return value
-                // is not transferred via eax[/edx]:
-                *static_cast< void ** >(pReturnValue) = pCppReturn;
-            }
-        }
-        if (pReturnTypeDescr)
-        {
-            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
-        }
-    }
-}
-
-
-//==================================================================================================
-extern "C" void cpp_vtable_call(
-    int nFunctionIndex, int nVtableOffset, void** pCallStack,
-    void * pReturnValue )
-{
-    OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
-
-    // pCallStack: ret adr, [ret *], this, params
-    void * pThis;
-    if( nFunctionIndex & 0x80000000 )
-    {
-        nFunctionIndex &= 0x7fffffff;
-        pThis = pCallStack[2];
-    }
-    else
-    {
-        pThis = pCallStack[1];
-    }
-    pThis = static_cast< char * >(pThis) - nVtableOffset;
-    bridges::cpp_uno::shared::CppInterfaceProxy * pCppI
-        = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
-            pThis);
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "%p %p %p pThis=%p, pCppI=%p, function index=%d, vtable offset=%d\n", pCallStack[0], pCallStack[1], pCallStack[2], pThis, pCppI, nFunctionIndex, nVtableOffset );
-#endif
-    typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
-#if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "name=%s\n", rtl::OUStringToOString(pTypeDescr->aBase.pTypeName, RTL_TEXTENCODING_UTF8).getStr() );
-#endif
-    OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" );
-    if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
-    {
-        throw RuntimeException(
-            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "illegal vtable index!" )),
-            (XInterface *)pThis );
-    }
-
-    // determine called method
-    sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
-    OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" );
-
-    TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
-#if OSL_DEBUG_LEVEL > 1
-    fprintf(stderr, "calling %s\n", rtl::OUStringToOString(aMemberDescr.get()->pTypeName, RTL_TEXTENCODING_UTF8).getStr());
-#endif
-    switch (aMemberDescr.get()->eTypeClass)
-    {
-    case typelib_TypeClass_INTERFACE_ATTRIBUTE:
-    {
-        if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex)
-        {
-            // is GET method
-            cpp2uno_call(
-                pCppI, aMemberDescr.get(),
-                ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
-                0, 0, // no params
-                pCallStack, pReturnValue );
-        }
-        else
-        {
-            // is SET method
-            typelib_MethodParameter aParam;
-            aParam.pTypeRef =
-                ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
-            aParam.bIn      = sal_True;
-            aParam.bOut     = sal_False;
-
-            cpp2uno_call(
-                pCppI, aMemberDescr.get(),
-                0, // indicates void return
-                1, &aParam,
-                pCallStack, pReturnValue );
-        }
-        break;
-    }
-    case typelib_TypeClass_INTERFACE_METHOD:
-    {
-        // is METHOD
-        switch (nFunctionIndex)
-        {
-        case 1: // acquire()
-            pCppI->acquireProxy(); // non virtual call!
-            break;
-        case 2: // release()
-            pCppI->releaseProxy(); // non virtual call!
-            break;
-        case 0: // queryInterface() opt
-        {
-            typelib_TypeDescription * pTD = 0;
-            TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pCallStack[3] )->getTypeLibType() );
-            if (pTD)
-            {
-                XInterface * pInterface = 0;
-                (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
-                    pCppI->getBridge()->getCppEnv(),
-                    (void **)&pInterface, pCppI->getOid().pData,
-                    (typelib_InterfaceTypeDescription *)pTD );
-
-                if (pInterface)
-                {
-                    ::uno_any_construct(
-                        reinterpret_cast< uno_Any * >( pCallStack[1] ),
-                        &pInterface, pTD, cpp_acquire );
-                    pInterface->release();
-                    TYPELIB_DANGER_RELEASE( pTD );
-                    *static_cast< void ** >(pReturnValue) = pCallStack[1];
-                    break;
-                }
-                TYPELIB_DANGER_RELEASE( pTD );
-            }
-        } // else perform queryInterface()
-        default:
-            cpp2uno_call(
-                pCppI, aMemberDescr.get(),
-                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
-                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
-                ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
-                pCallStack, pReturnValue );
-        }
-        break;
-    }
-    default:
-    {
-        throw RuntimeException(
-            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no member description found!" )),
-            (XInterface *)pThis );
-    }
-    }
-}
-
-//==================================================================================================
-extern "C" { 
-extern int nFunIndexes, nVtableOffsets;
-extern int codeSnippets[];
-}
-
-unsigned char * codeSnippet(
-    sal_Int32 functionIndex, sal_Int32 vtableOffset,
-#ifdef __arm
-    bool bHasHiddenParam
-#else
-    typelib_TypeDescriptionReference * pReturnTypeRef
-#endif
-                            )
-{
-    OSL_ASSERT(functionIndex < nFunIndexes);
-    if (!(functionIndex < nFunIndexes))
-        return NULL;
-
-    OSL_ASSERT(vtableOffset < nVtableOffsets);
-    if (!(vtableOffset < nVtableOffsets))
-        return NULL;
-    
-#ifdef __arm
-    return ((unsigned char *) &codeSnippets) + codeSnippets[functionIndex*nVtableOffsets*2 + vtableOffset*2 + bHasHiddenParam];
-#else
-    enum { General, Void, Hyper, Float, Double, Class } exec;
-    bool bHasHiddenParam = false;
-    if (pReturnTypeRef == 0) {
-        exec = Void;
-    }
-    else {
-        switch (pReturnTypeRef->eTypeClass) {
-        case typelib_TypeClass_VOID:
-            exec = Void;
-            break;
-        case typelib_TypeClass_HYPER:
-        case typelib_TypeClass_UNSIGNED_HYPER:
-            exec = Hyper;
-            break;
-        case typelib_TypeClass_FLOAT:
-            exec = Float;
-            break;
-        case typelib_TypeClass_DOUBLE:
-            exec = Double;
-            break;
-        case typelib_TypeClass_STRUCT:
-        case typelib_TypeClass_EXCEPTION: {
-            typelib_TypeDescription * pReturnTypeDescr = 0;
-            TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
-            bool const bSimpleReturnStruct =
-                CPPU_CURRENT_NAMESPACE::isSimpleReturnType(pReturnTypeDescr);
-            sal_Int32 const nRetSize = pReturnTypeDescr->nSize;
-            TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
-            if (bSimpleReturnStruct && nRetSize <= 8) {
-                exec = General; // fills eax
-                if (nRetSize > 4)
-                    exec = Hyper; // fills eax/edx
-                break;
-            }
-        }
-        case typelib_TypeClass_STRING:
-        case typelib_TypeClass_TYPE:
-        case typelib_TypeClass_SEQUENCE:
-        case typelib_TypeClass_INTERFACE:
-        case typelib_TypeClass_ANY:
-            bHasHiddenParam = 1;
-            exec = Class;
-            break;
-        default:
-            exec = General;
-            break;
-        }
-    }
-
-    // The codeSnippets table is indexed by functionIndex, vtableOffset, exec and flag
-
-    fprintf(stderr, "Indexing codeSnippets with %ld [%ld,%ld,%d,%d]\n",
-            functionIndex*nVtableOffsets*6*2 + vtableOffset*6*2 + exec*2 + bHasHiddenParam,
-            functionIndex, vtableOffset, (int) exec, bHasHiddenParam);
-    return ((unsigned char *) &codeSnippets) + codeSnippets[functionIndex*nVtableOffsets*6*2 + vtableOffset*6*2 + exec*2 + bHasHiddenParam];
-#endif
-}
-
-}
-
-struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
-
-bridges::cpp_uno::shared::VtableFactory::Slot *
-bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
-{
-    return static_cast< Slot * >(block) + 2;
-}
-
-sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
-    sal_Int32 slotCount)
-{
-#ifdef __arm
-    // ???
-    return (slotCount + 2) * sizeof (Slot);
-#else
-    return (slotCount + 2) * sizeof (Slot);
-#endif
-}
-
-bridges::cpp_uno::shared::VtableFactory::Slot *
-bridges::cpp_uno::shared::VtableFactory::initializeBlock(
-    void * block, sal_Int32 slotCount)
-{
-    Slot * slots = mapBlockToVtable(block);
-    slots[-2].fn = 0;
-    slots[-1].fn = 0;
-    return slots + slotCount;
-}
-
-unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
-    typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
-    sal_Int32 functionCount, sal_Int32 vtableOffset)
-{
-    (*slots) -= functionCount;
-    Slot * s = *slots;
-    for (sal_Int32 i = 0; i < type->nMembers; ++i) {
-        typelib_TypeDescription * member = 0;
-        TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
-        OSL_ASSERT(member != 0);
-        switch (member->eTypeClass) {
-        case typelib_TypeClass_INTERFACE_ATTRIBUTE:
-        {
-#ifdef __arm
-            typelib_InterfaceAttributeTypeDescription *pAttrTD =
-                reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( member );
-#endif
-            // Getter:
-            (s++)->fn = codeSnippet(
-                functionOffset++, vtableOffset,
-#ifdef __arm
-                arm::return_in_hidden_param( pAttrTD->pAttributeTypeRef )
-#else
-                reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
-                    member)->pAttributeTypeRef
-#endif
-                                    );
-            // Setter:
-            if (!reinterpret_cast<
-                typelib_InterfaceAttributeTypeDescription * >(
-                    member)->bReadOnly)
-            {
-                (s++)->fn = codeSnippet(
-                    functionOffset++, vtableOffset,
-#ifdef __arm
-                    false
-#else
-                    0 /* indicates VOID */
-#endif
-                                        );
-            }
-            break;
-        }
-        case typelib_TypeClass_INTERFACE_METHOD:
-        {
-#ifdef __arm
-            typelib_InterfaceMethodTypeDescription *pMethodTD =
-                reinterpret_cast<
-                typelib_InterfaceMethodTypeDescription * >(member);
-#endif
-            (s++)->fn = codeSnippet(
-                functionOffset++, vtableOffset,
-#ifdef __arm
-                arm::return_in_hidden_param(pMethodTD->pReturnTypeRef)
-#else
-                reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
-                    member)->pReturnTypeRef
-#endif
-                                    );
-            break;
-        }
-        default:
-            OSL_ASSERT(false);
-            break;
-        }
-        TYPELIB_DANGER_RELEASE(member);
-    }
-    return code;
-}
-
 void bridges::cpp_uno::shared::VtableFactory::flushCode(
     unsigned char const *, unsigned char const *)
 {
+    // No dynamic code generation so nothing to flush
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl b/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl
index 2e6d6fe..0599170 100755
--- a/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/generate-snippets.pl
@@ -50,7 +50,17 @@ sub gen_x86 ($$$)
 printf (".text\n");
 
 printf ("#ifdef __arm\n");
+
+printf ("\n");
+printf ("@ Each codeSnippetX function stores pc into ip and branches to _privateSnippetExecutor\n");
+printf ("@ The branch instruction is followed by two longs (that ip thus points to):\n");
+printf ("@ - the function index, as such and with the 0x80000000 bit set\n");
+printf ("@   (to indicate a hidden parameter for returning large values)\n");
+printf ("@ - the vtable offset\n");
+printf ("\n");
+
 printf ("\t.align 4\n");
+printf ("\n");
 
 foreach my $funIndex (0 .. $nFunIndexes-1)
 {
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/helper.s b/bridges/source/cpp_uno/gcc3_ios_arm/helper.s
index 1221087..6df0c25 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/helper.s
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/helper.s
@@ -26,7 +26,6 @@
 @ Fixed by Michael Casadevall <mcasadevall at kubuntu.org>
 @ Modified for iOS by Tor Lillqvist <tml at iki.fi>
 
-	.file	"helper.S"
 	.text
 	.align	4
 
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/rtti.h b/bridges/source/cpp_uno/gcc3_ios_arm/rtti.h
new file mode 100644
index 0000000..ec8ea8e
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/rtti.h
@@ -0,0 +1,412 @@
+// Copyright (C) 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+//
+// This file is part of GCC.
+//
+// GCC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+// 
+// GCC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+// 
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING.  If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+// Written by Nathan Sidwell, Codesourcery LLC, <nathan at codesourcery.com>
+#ifndef __RTTI_H
+#define __RTTI_H 
+
+#include <typeinfo>
+
+namespace __cxxabiv1
+{
+  // Type information for int, float etc.
+  class __fundamental_type_info : public std::type_info
+  {
+  public:
+    explicit 
+    __fundamental_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual 
+    ~__fundamental_type_info();
+  };
+
+  // Type information for array objects.
+  class __array_type_info : public std::type_info
+  {
+  public:
+    explicit 
+    __array_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual 
+    ~__array_type_info();
+  };
+
+  // Type information for functions (both member and non-member).
+  class __function_type_info : public std::type_info
+  {
+  public:
+    explicit 
+    __function_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual 
+    ~__function_type_info();
+
+  protected:
+    // Implementation defined member function.
+    virtual bool 
+    __is_function_p() const;
+  };
+
+  // Type information for enumerations.
+  class __enum_type_info : public std::type_info
+  {
+  public:
+    explicit 
+    __enum_type_info(const char* __n) : std::type_info(__n) { }
+
+    virtual 
+    ~__enum_type_info();
+  };
+
+  // Common type information for simple pointers and pointers to member.
+  class __pbase_type_info : public std::type_info
+  {
+  public:
+    unsigned int 		__flags; // Qualification of the target object.
+    const std::type_info* 	__pointee; // Type of pointed to object.
+
+    explicit 
+    __pbase_type_info(const char* __n, int __quals, 
+		      const std::type_info* __type)
+    : std::type_info(__n), __flags(__quals), __pointee(__type)
+    { }
+    
+    virtual 
+    ~__pbase_type_info();
+
+    // Implementation defined type.
+    enum __masks 
+      {
+	__const_mask = 0x1,
+	__volatile_mask = 0x2,
+	__restrict_mask = 0x4,
+	__incomplete_mask = 0x8,
+	__incomplete_class_mask = 0x10
+      };
+
+  protected:
+    __pbase_type_info(const __pbase_type_info&);
+
+    __pbase_type_info&
+    operator=(const __pbase_type_info&);
+
+    // Implementation defined member functions.
+    virtual bool 
+    __do_catch(const std::type_info* __thr_type, void** __thr_obj, 
+	       unsigned int __outer) const;
+
+    inline virtual bool 
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+		    unsigned __outer) const;
+  };
+
+  // Type information for simple pointers.
+  class __pointer_type_info : public __pbase_type_info
+  {
+  public:
+    explicit 
+    __pointer_type_info(const char* __n, int __quals, 
+			const std::type_info* __type)
+    : __pbase_type_info (__n, __quals, __type) { }
+
+
+    virtual 
+    ~__pointer_type_info();
+
+  protected:
+    // Implementation defined member functions.
+    virtual bool 
+    __is_pointer_p() const;
+
+    virtual bool 
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, 
+		    unsigned __outer) const;
+  };
+
+  class __class_type_info;
+
+  // Type information for a pointer to member variable.
+  class __pointer_to_member_type_info : public __pbase_type_info
+  {
+  public:
+    __class_type_info* __context;   // Class of the member.
+
+    explicit 
+    __pointer_to_member_type_info(const char* __n, int __quals,
+				  const std::type_info* __type, 
+				  __class_type_info* __klass)
+    : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
+
+    virtual 
+    ~__pointer_to_member_type_info();
+
+  protected:
+    __pointer_to_member_type_info(const __pointer_to_member_type_info&);
+
+    __pointer_to_member_type_info&
+    operator=(const __pointer_to_member_type_info&);
+
+    // Implementation defined member function.
+    virtual bool 
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
+		    unsigned __outer) const;
+  };
+
+  // Helper class for __vmi_class_type.
+  class __base_class_type_info
+  {
+  public:
+    const __class_type_info* 	__base_type;  // Base class type.
+    long 			__offset_flags;  // Offset and info.
+
+    enum __offset_flags_masks 
+      {
+	__virtual_mask = 0x1,
+	__public_mask = 0x2,
+	__hwm_bit = 2,
+	__offset_shift = 8          // Bits to shift offset.
+      };
+  
+    // Implementation defined member functions.
+    bool 
+    __is_virtual_p() const
+    { return __offset_flags & __virtual_mask; }
+
+    bool 
+    __is_public_p() const
+    { return __offset_flags & __public_mask; }
+
+    ptrdiff_t 
+    __offset() const
+    { 
+      // This shift, being of a signed type, is implementation
+      // defined. GCC implements such shifts as arithmetic, which is
+      // what we want.
+      return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
+    }
+  };
+
+  // Type information for a class.
+  class __class_type_info : public std::type_info
+  {
+  public:
+    explicit 
+    __class_type_info (const char *__n) : type_info(__n) { }
+
+    virtual 
+    ~__class_type_info ();
+
+    // Implementation defined types.
+    // The type sub_kind tells us about how a base object is contained
+    // within a derived object. We often do this lazily, hence the
+    // UNKNOWN value. At other times we may use NOT_CONTAINED to mean
+    // not publicly contained.
+    enum __sub_kind
+      {
+	// We have no idea.
+	__unknown = 0, 
+
+	// Not contained within us (in some circumstances this might
+	// mean not contained publicly)
+	__not_contained, 
+
+	// Contained ambiguously.
+	__contained_ambig, 
+    
+	// Via a virtual path.
+	__contained_virtual_mask = __base_class_type_info::__virtual_mask, 
+
+	// Via a public path.
+	__contained_public_mask = __base_class_type_info::__public_mask,   
+
+	// Contained within us.
+	__contained_mask = 1 << __base_class_type_info::__hwm_bit,
+    
+	__contained_private = __contained_mask,
+	__contained_public = __contained_mask | __contained_public_mask
+      };
+
+    struct __upcast_result;
+    struct __dyncast_result;
+
+  protected:
+    // Implementation defined member functions.
+    virtual bool 
+    __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
+
+    virtual bool 
+    __do_catch(const type_info* __thr_type, void** __thr_obj, 
+	       unsigned __outer) const;
+
+  public:
+    // Helper for upcast. See if DST is us, or one of our bases. 
+    // Return false if not found, true if found. 
+    virtual bool 
+    __do_upcast(const __class_type_info* __dst, const void* __obj,
+		__upcast_result& __restrict __result) const;
+
+    // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
+    // within OBJ_PTR. OBJ_PTR points to a base object of our type,
+    // which is the destination type. SRC2DST indicates how SRC
+    // objects might be contained within this type.  If SRC_PTR is one
+    // of our SRC_TYPE bases, indicate the virtuality. Returns
+    // not_contained for non containment or private containment.
+    inline __sub_kind 
+    __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+		      const __class_type_info* __src_type, 
+		      const void* __src_ptr) const;
+
+    // Helper for dynamic cast. ACCESS_PATH gives the access from the
+    // most derived object to this base. DST_TYPE indicates the
+    // desired type we want. OBJ_PTR points to a base of our type
+    // within the complete object. SRC_TYPE indicates the static type
+    // started from and SRC_PTR points to that base within the most
+    // derived object. Fill in RESULT with what we find. Return true
+    // if we have located an ambiguous match.
+    virtual bool 
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+		 const __class_type_info* __dst_type, const void* __obj_ptr, 
+		 const __class_type_info* __src_type, const void* __src_ptr, 
+		 __dyncast_result& __result) const;
+    
+    // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
+    // bases are inherited by the type started from -- which is not
+    // necessarily the current type. The current type will be a base
+    // of the destination type.  OBJ_PTR points to the current base.
+    virtual __sub_kind 
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+			 const __class_type_info* __src_type,
+			 const void* __src_ptr) const;
+  };
+
+  // Type information for a class with a single non-virtual base.
+  class __si_class_type_info : public __class_type_info
+  {
+  public:
+    const __class_type_info* __base_type;
+
+    explicit 
+    __si_class_type_info(const char *__n, const __class_type_info *__base)
+    : __class_type_info(__n), __base_type(__base) { }
+
+    virtual 
+    ~__si_class_type_info();
+
+  protected:
+    __si_class_type_info(const __si_class_type_info&);
+
+    __si_class_type_info&
+    operator=(const __si_class_type_info&);
+
+    // Implementation defined member functions.
+    virtual bool 
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+		 const __class_type_info* __dst_type, const void* __obj_ptr,
+		 const __class_type_info* __src_type, const void* __src_ptr,
+		 __dyncast_result& __result) const;
+
+    virtual __sub_kind 
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
+			 const __class_type_info* __src_type,
+			 const void* __sub_ptr) const;
+
+    virtual bool 
+    __do_upcast(const __class_type_info*__dst, const void*__obj,
+		__upcast_result& __restrict __result) const;
+  };
+
+  // Type information for a class with multiple and/or virtual bases.
+  class __vmi_class_type_info : public __class_type_info 
+  {
+  public:
+    unsigned int 		__flags;  // Details about the class hierarchy.
+    unsigned int 		__base_count;  // Number of direct bases.
+
+    // The array of bases uses the trailing array struct hack so this
+    // class is not constructable with a normal constructor. It is
+    // internally generated by the compiler.
+    __base_class_type_info 	__base_info[1];  // Array of bases.
+
+    explicit 
+    __vmi_class_type_info(const char* __n, int ___flags)
+    : __class_type_info(__n), __flags(___flags), __base_count(0) { }
+
+    virtual 
+    ~__vmi_class_type_info();
+
+    // Implementation defined types.
+    enum __flags_masks 
+      {
+	__non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
+	__diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
+	__flags_unknown_mask = 0x10
+      };
+
+  protected:
+    // Implementation defined member functions.
+    virtual bool 
+    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
+		 const __class_type_info* __dst_type, const void* __obj_ptr,
+		 const __class_type_info* __src_type, const void* __src_ptr,
+		 __dyncast_result& __result) const;
+
+    virtual __sub_kind 
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, 
+			 const __class_type_info* __src_type,
+			 const void* __src_ptr) const;
+    
+    virtual bool 
+    __do_upcast(const __class_type_info* __dst, const void* __obj,
+		__upcast_result& __restrict __result) const;
+  };
+
+  // Dynamic cast runtime.
+  // src2dst has the following possible values
+  //  >-1: src_type is a unique public non-virtual base of dst_type
+  //       dst_ptr + src2dst == src_ptr
+  //   -1: unspecified relationship
+  //   -2: src_type is not a public base of dst_type
+  //   -3: src_type is a multiple public non-virtual base of dst_type
+  extern "C" void*
+  __dynamic_cast(const void* __src_ptr, // Starting object.
+		 const __class_type_info* __src_type, // Static type of object.
+		 const __class_type_info* __dst_type, // Desired target type.
+		 ptrdiff_t __src2dst); // How src and dst are related.
+
+
+  // Returns the type_info for the currently handled exception [15.3/8], or
+  // null if there is none.
+  extern "C" std::type_info*
+  __cxa_current_exception_type();
+} // namespace __cxxabiv1
+
+// User programs should use the alias `abi'. 
+namespace abi = __cxxabiv1;
+
+
+#endif // __RTTI_H 
diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/share.hxx b/bridges/source/cpp_uno/gcc3_ios_arm/share.hxx
index b2f679a..37ae457 100644
--- a/bridges/source/cpp_uno/gcc3_ios_arm/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_ios_arm/share.hxx
@@ -21,551 +21,34 @@
 
 #include <typeinfo>
 #include <exception>
-#include <unwind.h>
 #include <cstddef>
 
-// rtti.h from http://www.opensource.apple.com/source/libcppabi/libcppabi-14/include/rtti.h
-// No idea if the correct one...
+// from opensource.apple.com: libcppabi-24.4/include/rtti.h
+#include "rtti.h"
 
-// Copyright (C) 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
-//
-// This file is part of GCC.
-//
-// GCC is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
-//
-// GCC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with GCC; see the file COPYING.  If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02110-1301, USA.
+// from opensource.apple.com: libcppabi-24.4/include/unwind-cxx.h
+#include "unwind-cxx.h"
 
-// As a special exception, you may use this file as part of a free software
-// library without restriction.  Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License.  This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-// Written by Nathan Sidwell, Codesourcery LLC, <nathan at codesourcery.com>
-#ifndef __RTTI_H
-#define __RTTI_H
-
-#include <typeinfo>
-
-namespace __cxxabiv1
-{
-    // Type information for int, float etc.
-    class __fundamental_type_info : public std::type_info
-    {
-    public:
-    explicit
-    __fundamental_type_info(const char* __n) : std::type_info(__n) { }
-
-    virtual
-    ~__fundamental_type_info();
-    };
-
-    // Type information for array objects.
-    class __array_type_info : public std::type_info
-    {
-    public:
-    explicit
-    __array_type_info(const char* __n) : std::type_info(__n) { }
-
-    virtual
-    ~__array_type_info();
-    };
-
-    // Type information for functions (both member and non-member).
-    class __function_type_info : public std::type_info
-    {
-    public:
-    explicit
-    __function_type_info(const char* __n) : std::type_info(__n) { }
-
-    virtual
-    ~__function_type_info();
-
-    protected:
-        // Implementation defined member function.
-    virtual bool
-    __is_function_p() const;
-    };
-
-    // Type information for enumerations.
-    class __enum_type_info : public std::type_info
-    {
-    public:
-    explicit
-    __enum_type_info(const char* __n) : std::type_info(__n) { }
-
-    virtual
-    ~__enum_type_info();
-    };
-
-    // Common type information for simple pointers and pointers to member.
-    class __pbase_type_info : public std::type_info
-    {
-    public:
-        unsigned int __flags; // Qualification of the target object.
-        const std::type_info* __pointee; // Type of pointed to object.
-
-    explicit
-    __pbase_type_info(const char* __n, int __quals,
-                      const std::type_info* __type)
-        : std::type_info(__n), __flags(__quals), __pointee(__type)
-        { }
-
-    virtual
-    ~__pbase_type_info();
-
-        // Implementation defined type.
-    enum __masks
-        {
-            __const_mask = 0x1,
-            __volatile_mask = 0x2,
-            __restrict_mask = 0x4,
-            __incomplete_mask = 0x8,
-            __incomplete_class_mask = 0x10
-        };
-
-    protected:
-        __pbase_type_info(const __pbase_type_info&);
-
-    __pbase_type_info&
-    operator=(const __pbase_type_info&);
-
-        // Implementation defined member functions.
-    virtual bool
-    __do_catch(const std::type_info* __thr_type, void** __thr_obj,
-               unsigned int __outer) const;
-
-    inline virtual bool
-    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
-                    unsigned __outer) const;
-    };
-
-    // Type information for simple pointers.
-    class __pointer_type_info : public __pbase_type_info
-    {
-    public:
-    explicit
-    __pointer_type_info(const char* __n, int __quals,
-                        const std::type_info* __type)
-        : __pbase_type_info (__n, __quals, __type) { }
-
-
-    virtual
-    ~__pointer_type_info();
-
-    protected:
-        // Implementation defined member functions.
-    virtual bool
-    __is_pointer_p() const;
-
-    virtual bool
-    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
-                    unsigned __outer) const;
-    };
-
-    class __class_type_info;
-
-    // Type information for a pointer to member variable.
-    class __pointer_to_member_type_info : public __pbase_type_info
-    {
-    public:
-        __class_type_info* __context;   // Class of the member.
-
-    explicit
-    __pointer_to_member_type_info(const char* __n, int __quals,
-                                  const std::type_info* __type,
-                                  __class_type_info* __klass)
-        : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
-
-    virtual
-    ~__pointer_to_member_type_info();
-
-    protected:
-        __pointer_to_member_type_info(const __pointer_to_member_type_info&);
-
-    __pointer_to_member_type_info&
-    operator=(const __pointer_to_member_type_info&);
-
-        // Implementation defined member function.
-    virtual bool
-    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
-                    unsigned __outer) const;
-    };
-
-    // Helper class for __vmi_class_type.
-  class __base_class_type_info
-  {
-  public:
-      const __class_type_info* __base_type;  // Base class type.
-      long __offset_flags;  // Offset and info.
-
-    enum __offset_flags_masks
-        {
-            __virtual_mask = 0x1,
-            __public_mask = 0x2,
-            __hwm_bit = 2,
-            __offset_shift = 8          // Bits to shift offset.
-        };
-
-      // Implementation defined member functions.
-    bool
-    __is_virtual_p() const
-      { return __offset_flags & __virtual_mask; }
-
-    bool
-    __is_public_p() const
-      { return __offset_flags & __public_mask; }
-
-    ptrdiff_t
-    __offset() const
-      {
-          // This shift, being of a signed type, is implementation
-          // defined. GCC implements such shifts as arithmetic, which is
-          // what we want.
-          return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
-      }
-  };
-
-    // Type information for a class.
-    class __class_type_info : public std::type_info
-    {
-    public:
-    explicit
-    __class_type_info (const char *__n) : type_info(__n) { }
-
-    virtual
-    ~__class_type_info ();
-
-        // Implementation defined types.
-        // The type sub_kind tells us about how a base object is contained
-        // within a derived object. We often do this lazily, hence the
-        // UNKNOWN value. At other times we may use NOT_CONTAINED to mean
-        // not publicly contained.
-    enum __sub_kind
-        {
-            // We have no idea.
-            __unknown = 0,
-
-            // Not contained within us (in some circumstances this might
-            // mean not contained publicly)
-            __not_contained,
-
-            // Contained ambiguously.
-            __contained_ambig,
-
-            // Via a virtual path.
-            __contained_virtual_mask = __base_class_type_info::__virtual_mask,
-
-            // Via a public path.
-            __contained_public_mask = __base_class_type_info::__public_mask,
-
-            // Contained within us.
-            __contained_mask = 1 << __base_class_type_info::__hwm_bit,
-
-            __contained_private = __contained_mask,
-            __contained_public = __contained_mask | __contained_public_mask
-        };
-
-        struct __upcast_result;
-        struct __dyncast_result;
-
-    protected:
-        // Implementation defined member functions.
-    virtual bool
-    __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
-
-    virtual bool
-    __do_catch(const type_info* __thr_type, void** __thr_obj,
-               unsigned __outer) const;
-
-    public:
-        // Helper for upcast. See if DST is us, or one of our bases.
-        // Return false if not found, true if found.
-    virtual bool
-    __do_upcast(const __class_type_info* __dst, const void* __obj,
-                __upcast_result& __restrict __result) const;
-
-        // Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
-        // within OBJ_PTR. OBJ_PTR points to a base object of our type,
-        // which is the destination type. SRC2DST indicates how SRC
-        // objects might be contained within this type.  If SRC_PTR is one
-        // of our SRC_TYPE bases, indicate the virtuality. Returns
-        // not_contained for non containment or private containment.
-    inline __sub_kind
-    __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
-                      const __class_type_info* __src_type,
-                      const void* __src_ptr) const;
-
-        // Helper for dynamic cast. ACCESS_PATH gives the access from the
-        // most derived object to this base. DST_TYPE indicates the
-        // desired type we want. OBJ_PTR points to a base of our type
-        // within the complete object. SRC_TYPE indicates the static type
-        // started from and SRC_PTR points to that base within the most
-        // derived object. Fill in RESULT with what we find. Return true
-        // if we have located an ambiguous match.
-    virtual bool
-    __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
-                 const __class_type_info* __dst_type, const void* __obj_ptr,
-                 const __class_type_info* __src_type, const void* __src_ptr,
-                 __dyncast_result& __result) const;
-
-        // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
-        // bases are inherited by the type started from -- which is not
-        // necessarily the current type. The current type will be a base

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list