You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Απόστολος Συρόπουλος <as...@hotmail.com> on 2014/01/27 17:04:00 UTC

Compilinng the gcc_solaris_intel bridge

Hello,

After a number of efforts I have finally managed to find the proper patch for
file bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx and so
to build a functional bridge for Solaris. Previously, I could not build
the testtools module but now they compile just fine. Here is the patch:

--- bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx.old    Δευ Ιαν 27 17:38:53 2014
+++ bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx    Δευ Ιαν 27 17:34:30 2014
@@ -45,12 +45,20 @@
 {
 
 //==================================================================================================
-static void callVirtualMethod(
+void callVirtualMethod(
     void * pAdjustedThisPtr,
     sal_Int32 nVtableIndex,
     void * pRegisterReturn,
     typelib_TypeClass eReturnType,
     sal_Int32 * pStackLongs,
+    sal_Int32 nStackLongs ) __attribute__((noinline));
+
+void callVirtualMethod(
+    void * pAdjustedThisPtr,
+    sal_Int32 nVtableIndex,
+    void * pRegisterReturn,
+    typelib_TypeClass eReturnType,
+    sal_Int32 * pStackLongs,
     sal_Int32 nStackLongs )
 {
     // parameter list is mixed list of * and values
@@ -67,6 +75,13 @@
     void * stackptr;
     asm volatile (
         "mov   %%esp, %6\n\t"
+       // preserve potential 128bit stack alignment
+        "and   $0xfffffff0, %%esp\n\t"
+        "mov   %0, %%eax\n\t"
+        "lea   -4(,%%eax,4), %%eax\n\t"
+        "and   $0xf, %%eax\n\t"
+        "sub   $0xc, %%eax\n\t"
+        "add   %%eax, %%esp\n\t"
         // copy values
         "mov   %0, %%eax\n\t"
         "mov   %%eax, %%edx\n\t"

Of course the patch is just a copy of the corresponding Linux patch, but
I was not sure whether it work!

A.S.

--
Apostols Syropoulos
Xanthi, Greece

 		 	   		  

Re: Compilinng the gcc_solaris_intel bridge

Posted by Herbert Duerr <hd...@apache.org>.
Hi Apostolos,

On 27.01.2014 17:04, Απόστολος Συρόπουλος wrote:
> After a number of efforts I have finally managed to find the proper patch for
> file bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx and so
> to build a functional bridge for Solaris. Previously, I could not build
> the testtools module but now they compile just fine.

Congratulations on solving this last critical step!

> Here is the patch:
> [...]
> --- bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx.old    Δευ Ιαν 27 17:38:53 2014
> +++ bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx    Δευ Ιαν 27 17:34:30 2014
> [...]
> +       // preserve potential 128bit stack alignment
> +        "and   $0xfffffff0, %%esp\n\t"
> +        "mov   %0, %%eax\n\t"
> +        "lea   -4(,%%eax,4), %%eax\n\t"
> +        "and   $0xf, %%eax\n\t"
> +        "sub   $0xc, %%eax\n\t"
> +        "add   %%eax, %%esp\n\t"
>           // copy values
>           "mov   %0, %%eax\n\t"
>           "mov   %%eax, %%edx\n\t"

This looks very much like the change for issue 108371, which means that 
the patch is licensed properly for our project.

> Of course the patch is just a copy of the corresponding Linux patch, but
> I was not sure whether it work!

I'm glad you tried it out!

Herbert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


RE: Compilinng the gcc_solaris_intel bridge

Posted by Απόστολος Συρόπουλος <as...@hotmail.com>.
Hello Herbert,


> >[...]
> > +       // preserve potential 128bit stack alignment
> 
> I'm not sure whether the SPARCv9 ABI spec is relevant for your build 
> environment, but it mentions this 16byte stack alignment in [1] as 
> something new. Maybe the other changes may be relevant too to solve the 
> bridge problems.

Well, as I said my patch is based on the code found in the corresponding
gcc3-linux-intel file. Obviously, this has nothing to do with SPARC machines,
but then again it might be some kind of leftover.
 
> In particular I'd also suggest to mark the ecx register as clobbered 
> like we do in [2] by changing the line:
> 	: "eax", "edx"
> to
> 	: "eax", "edx", "ecx"
> 

I have changed this and it still compiles the testtools.

A.S.
--
Apostols Syropoulos
Xanthi, Greece

 		 	   		  

Re: Compilinng the gcc_solaris_intel bridge

Posted by Herbert Duerr <hd...@apache.org>.
Another reply to your fix in the Solaris bridge module.

On 27.01.2014 17:04, Απόστολος Συρόπουλος wrote:
> After a number of efforts I have finally managed to find the proper patch for
> file bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx and so
> to build a functional bridge for Solaris. Previously, I could not build
> the testtools module but now they compile just fine. Here is the patch:
>[...]
> +       // preserve potential 128bit stack alignment

I'm not sure whether the SPARCv9 ABI spec is relevant for your build 
environment, but it mentions this 16byte stack alignment in [1] as 
something new. Maybe the other changes may be relevant too to solve the 
bridge problems.

In particular I'd also suggest to mark the ecx register as clobbered 
like we do in [2] by changing the line:
	: "eax", "edx"
to
	: "eax", "edx", "ecx"

[1] http://docs.oracle.com/cd/E18752_01/html/816-5138/fcowb.html
[2] https://svn.apache.org/r1468341

Herbert

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org