Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2012 11:22:44 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        office-list freebsd <freebsd-office@freebsd.org>
Cc:        Jan Henrik Sylvester <me@janh.de>, Maho Nakata <maho@FreeBSD.org>
Subject:   Re: editors/openoffice-3 fails on i386 while it builds on amd64
Message-ID:  <4FAD3CD4.50503@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030407020103070704070907
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello;

The problem seems to be caused by an incomplete update to
the bridge code. The attached patch (for the files directory)
should fix it.

I will go ahead and commit it upstream since it can't be more
broken than it currently is but I am not using i386 so some
success report would be good :).

Pedro.

--------------030407020103070704070907
Content-Type: text/plain;
 name="patch-doublemmap"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="patch-doublemmap"

Index: bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx
===================================================================
--- bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx	(revision 1337224)
+++ bridges/source/cpp_uno/gcc3_freebsd_intel/cpp2uno.cxx	(working copy)
@@ -355,7 +355,7 @@
 int const codeSnippetSize = 16;
 
 unsigned char * codeSnippet(
-    unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset,
+    unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 functionIndex, sal_Int32 vtableOffset,
     typelib_TypeClass returnTypeClass)
 {
     if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass)) {
@@ -401,7 +401,7 @@
     // jmp privateSnippetExecutor:
     *p++ = 0xE9;
     *reinterpret_cast< sal_Int32 * >(p)
-        = ((unsigned char *) exec) - p - sizeof (sal_Int32);
+        = ((unsigned char *) exec) - p - sizeof (sal_Int32) - writetoexecdiff;
     p += sizeof (sal_Int32);
     OSL_ASSERT(p - code <= codeSnippetSize);
     return code + codeSnippetSize;
@@ -434,7 +434,7 @@
 }
 
 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
-    Slot ** slots, unsigned char * code,
+    Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
@@ -447,9 +447,9 @@
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, writetoexecdiff, functionOffset++, vtableOffset,
                 reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
                     member)->pAttributeTypeRef->eTypeClass);
             // Setter:
@@ -457,17 +457,17 @@
                 typelib_InterfaceAttributeTypeDescription * >(
                     member)->bReadOnly)
             {
-                (s++)->fn = code;
+                (s++)->fn = code + writetoexecdiff;
                 code = codeSnippet(
-                    code, functionOffset++, vtableOffset,
+                    code, writetoexecdiff, functionOffset++, vtableOffset,
                     typelib_TypeClass_VOID);
             }
             break;
 
         case typelib_TypeClass_INTERFACE_METHOD:
-            (s++)->fn = code;
+            (s++)->fn = code + writetoexecdiff;
             code = codeSnippet(
-                code, functionOffset++, vtableOffset,
+                code, writetoexecdiff, functionOffset++, vtableOffset,
                 reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
                     member)->pReturnTypeRef->eTypeClass);
             break;

--------------030407020103070704070907--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FAD3CD4.50503>