diff --git a/editors/openoffice-4/files/patch-bridges_prj_build.lst b/editors/openoffice-4/files/patch-bridges_prj_build.lst new file mode 100644 index 000000000000..dc66f3102aa6 --- /dev/null +++ b/editors/openoffice-4/files/patch-bridges_prj_build.lst @@ -0,0 +1,12 @@ +--- bridges/prj/build.lst.orig ++++ bridges/prj/build.lst +@@ -9,6 +9,8 @@ + br bridges\source\cpp_uno\gcc3_freebsd_intel nmake - u br_gcc3fi br_cppuno_shared br_unotypes br_inc NULL + br bridges\source\cpp_uno\gcc3_linux_x86-64 nmake - u br_gcc3lx br_cppuno_shared br_unotypes br_inc NULL + br bridges\source\cpp_uno\gcc3_freebsd_x86-64 nmake - u br_gcc3fx br_cppuno_shared br_unotypes br_inc NULL ++br bridges\source\cpp_uno\gcc3_freebsd_powerpc nmake - u br_gcc3fp br_cppuno_shared br_unotypes br_inc NULL ++br bridges\source\cpp_uno\gcc3_freebsd_powerpc64 nmake - u br_gcc3fp_64 br_cppuno_shared br_unotypes br_inc NULL + br bridges\source\cpp_uno\gcc3_linux_powerpc nmake - u br_gcc3lp br_cppuno_shared br_unotypes br_inc NULL + br bridges\source\cpp_uno\gcc3_linux_powerpc64 nmake - u br_gcc3lp_64 br_cppuno_shared br_unotypes br_inc NULL + br bridges\source\cpp_uno\gcc3_linux_mips nmake - u br_gcc3lmips br_cppuno_shared br_unotypes br_inc NULL + diff --git a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s new file mode 100644 index 000000000000..f8c5e20e333e --- /dev/null +++ b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s @@ -0,0 +1,482 @@ +--- /dev/null ++++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/call.s +@@ -0,0 +1,478 @@ ++ .file "uno_ppc64_asm.cc" ++ .machine power4 ++ .abiversion 2 ++ .section ".text" ++ .align 2 ++ .globl callVirtualMethod ++ .type callVirtualMethod, @function ++callVirtualMethod: ++.LFB0: ++ .cfi_startproc ++.LCF0: ++0: addis 2,12,.TOC.-.LCF0@ha ++ addi 2,2,.TOC.-.LCF0@l ++ .localentry callVirtualMethod,.-callVirtualMethod ++ mflr 0 ++ std 0,16(1) ++ std 31,-8(1) ++ stdu 1,-208(1) ++ .cfi_def_cfa_offset 208 ++ .cfi_offset 65, 16 ++ .cfi_offset 31, -8 ++ mr 31,1 ++ .cfi_def_cfa_register 31 ++ std 3,136(31) ++ std 5,128(31) ++ std 6,120(31) ++ std 7,112(31) ++ std 9,104(31) ++ mr 9,4 ++ stw 9,248(31) ++ mr 9,8 ++ stw 9,280(31) ++ mr 9,10 ++ stw 9,296(31) ++ ld 9,304(31) ++ std 9,96(31) ++ ld 9,-28688(13) ++ std 9,184(31) ++ li 9,0 ++ lwz 9,280(31) ++ cmpwi 0,9,0 ++ beq 0,.L2 ++ lwz 9,280(31) ++ addi 9,9,1 ++ rldicl 9,9,0,32 ++ rlwinm 9,9,0,0,30 ++ stw 9,280(31) ++.L2: ++#ifdef __LITTLE_ENDIAN__ ++ lwz 9,312(31) ++#else ++ lwz 9,316(31) ++#endif ++ cmplwi 0,9,13 ++ ble 0,.L3 ++ li 9,13 ++#ifdef __LITTLE_ENDIAN__ ++ stw 9,312(31) ++#else ++ stw 9,316(31) ++#endif ++.L3: ++ lwz 9,296(31) ++ cmplwi 0,9,8 ++ ble 0,.L4 ++ li 9,8 ++ stw 9,296(31) ++.L4: ++ lwz 9,280(31) ++ slwi 9,9,3 ++ rldicl 9,9,0,32 ++ addi 9,9,15 ++ srdi 9,9,4 ++ sldi 9,9,4 ++ ld 10,0(1) ++ neg 9,9 ++ stdux 10,1,9 ++ addi 9,1,96 ++ addi 9,9,15 ++ srdi 9,9,4 ++ sldi 9,9,4 ++ std 9,160(31) ++ lwz 9,280(31) ++ slwi 9,9,3 ++ rldicl 9,9,0,32 ++ mr 8,9 ++ ld 10,160(31) ++ ld 9,112(31) ++ mr 5,8 ++ mr 4,9 ++ mr 3,10 ++ bl memcpy ++ nop ++ ld 9,136(31) ++ ld 9,0(9) ++ std 9,168(31) ++ lwz 9,248(31) ++ slwi 9,9,3 ++ rldicl 9,9,0,32 ++ mr 10,9 ++ ld 9,168(31) ++ add 9,9,10 ++ std 9,168(31) ++ ld 9,168(31) ++ ld 9,0(9) ++ std 9,168(31) ++ ld 9,168(31) ++ std 9,176(31) ++ ld 9,96(31) ++#APP ++ # 123 "uno_ppc64_asm.cc" 1 ++ lfd 1, 0(9) ++ lfd 2, 8(9) ++ lfd 3, 16(9) ++ lfd 4, 24(9) ++ lfd 5, 32(9) ++ lfd 6, 40(9) ++ lfd 7, 48(9) ++ lfd 8, 56(9) ++ lfd 9, 64(9) ++ lfd 10, 72(9) ++ lfd 11, 80(9) ++ lfd 12, 88(9) ++ lfd 13, 96(9) ++ ++ # 0 "" 2 ++#NO_APP ++ ld 9,104(31) ++ ld 3,0(9) ++ ld 9,104(31) ++ addi 9,9,8 ++ ld 4,0(9) ++ ld 9,104(31) ++ addi 9,9,16 ++ ld 5,0(9) ++ ld 9,104(31) ++ addi 9,9,24 ++ ld 6,0(9) ++ ld 9,104(31) ++ addi 9,9,32 ++ ld 7,0(9) ++ ld 9,104(31) ++ addi 9,9,40 ++ ld 8,0(9) ++ ld 9,104(31) ++ addi 9,9,48 ++ ld 0,0(9) ++ ld 9,104(31) ++ addi 9,9,56 ++ ld 9,0(9) ++ ld 11,176(31) ++ mr 10,9 ++ mr 9,0 ++ std 2,24(1) ++ mr 12,11 ++ mtctr 12 ++ bctrl ++ ld 2,24(1) ++#APP ++ # 149 "uno_ppc64_asm.cc" 1 ++ mr 3, 3 ++ mr 4, 4 ++ fmr 0, 1 ++ ++ # 0 "" 2 ++#NO_APP ++ stfd 0,152(31) ++ mr 9,3 ++ mr 10,4 ++ lfd 0,152(31) ++ ld 7,128(31) ++ ld 6,120(31) ++ fmr 1,0 ++ mr 4,10 ++ mr 3,9 ++ bl MapReturn ++ nop ++ nop ++ ld 9,184(31) ++ ld 10,-28688(13) ++ xor. 9,9,10 ++ li 10,0 ++ beq 0,.L5 ++ bl __stack_chk_fail ++ nop ++.L5: ++ addi 1,31,208 ++ .cfi_def_cfa 1, 0 ++ ld 0,16(1) ++ mtlr 0 ++ ld 31,-8(1) ++ blr ++ .long 0 ++ .byte 0,9,0,1,128,1,0,1 ++ .cfi_endproc ++.LFE0: ++ .size callVirtualMethod,.-callVirtualMethod ++ .section ".toc","aw" ++ .align 3 ++.LC0: ++ .quad .L9 ++ .section ".text" ++ .align 2 ++ .globl privateSnippetExecutor ++ .type privateSnippetExecutor, @function ++privateSnippetExecutor: ++.LFB1: ++ .cfi_startproc ++.LCF1: ++0: addis 2,12,.TOC.-.LCF1@ha ++ addi 2,2,.TOC.-.LCF1@l ++ .localentry privateSnippetExecutor,.-privateSnippetExecutor ++ mflr 0 ++ std 0,16(1) ++ std 31,-8(1) ++ stdu 1,-272(1) ++ .cfi_def_cfa_offset 272 ++ .cfi_offset 65, 16 ++ .cfi_offset 31, -8 ++ mr 31,1 ++ .cfi_def_cfa_register 31 ++ ld 0,-28688(13) ++ std 0,248(31) ++ li 0,0 ++ std 3,80(31) ++ std 4,88(31) ++ std 5,96(31) ++ std 6,104(31) ++ std 7,112(31) ++ std 8,120(31) ++ std 9,128(31) ++ mr 9,10 ++ std 9,136(31) ++ addi 9,31,144 ++#APP ++ # 173 "uno_ppc64_asm.cc" 1 ++ stfd 1, 0(9) ++stfd 2, 8(9) ++stfd 3, 16(9) ++stfd 4, 24(9) ++stfd 5, 32(9) ++stfd 6, 40(9) ++stfd 7, 48(9) ++stfd 8, 56(9) ++stfd 9, 64(9) ++stfd 10, 72(9) ++stfd 11, 80(9) ++stfd 12, 88(9) ++stfd 13, 96(9) ++ ++ # 0 "" 2 ++#NO_APP ++ std 11,48(31) ++ std 1,56(31) ++ ld 9,48(31) ++ addi 7,31,64 ++ addi 8,31,144 ++ addi 10,31,80 ++ ld 6,56(31) ++ mr 5,8 ++ mr 4,10 ++ mr 3,9 ++ bl cpp_mediate ++ nop ++ mr 9,3 ++ stw 9,44(31) ++ lwa 9,44(31) ++ cmplwi 0,9,15 ++ bgt 0,.L7 ++ sldi 10,9,2 ++ addis 8,2,.LC0@toc@ha ++ ld 9,.LC0@toc@l(8) ++ add 9,10,9 ++ lwz 10,0(9) ++ ld 9,.LC0@toc@l(8) ++ extsw 10,10 ++ add 9,10,9 ++ mtctr 9 ++ bctr ++ .p2align 2 ++ .align 2 ++.L9: ++ .long .L19-.L9 ++ .long .L13-.L9 ++ .long .L15-.L9 ++ .long .L15-.L9 ++ .long .L14-.L9 ++ .long .L13-.L9 ++ .long .L12-.L9 ++ .long .L8-.L9 ++ .long .L7-.L9 ++ .long .L7-.L9 ++ .long .L11-.L9 ++ .long .L10-.L9 ++ .long .L7-.L9 ++ .long .L7-.L9 ++ .long .L7-.L9 ++ .long .L8-.L9 ++.L15: ++#APP ++ # 209 "uno_ppc64_asm.cc" 1 ++ lbz 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L13: ++#APP ++ # 214 "uno_ppc64_asm.cc" 1 ++ lhz 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L14: ++#APP ++ # 218 "uno_ppc64_asm.cc" 1 ++ lha 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L8: ++#APP ++ # 223 "uno_ppc64_asm.cc" 1 ++ lwz 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L12: ++#APP ++ # 227 "uno_ppc64_asm.cc" 1 ++ lwa 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L11: ++ addi 9,31,64 ++#APP ++ # 231 "uno_ppc64_asm.cc" 1 ++ lfs 1,0(9) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L10: ++ addi 9,31,64 ++#APP ++ # 235 "uno_ppc64_asm.cc" 1 ++ lfd 1,0(9) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L7: ++#APP ++ # 239 "uno_ppc64_asm.cc" 1 ++ ld 3,64(31) ++ ++ # 0 "" 2 ++ # 241 "uno_ppc64_asm.cc" 1 ++ ld 4,72(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L19: ++ nop ++.L17: ++ nop ++ ld 9,248(31) ++ ld 10,-28688(13) ++ xor. 9,9,10 ++ li 10,0 ++ beq 0,.L18 ++ bl __stack_chk_fail ++ nop ++.L18: ++ addi 1,31,272 ++ .cfi_def_cfa 1, 0 ++ ld 0,16(1) ++ mtlr 0 ++ ld 31,-8(1) ++ blr ++ .long 0 ++ .byte 0,9,0,1,128,1,0,1 ++ .cfi_endproc ++.LFE1: ++ .size privateSnippetExecutor,.-privateSnippetExecutor ++ .section .rodata ++ .align 2 ++ .type _ZL15codeSnippetSize, @object ++ .size _ZL15codeSnippetSize, 4 ++_ZL15codeSnippetSize: ++ .long 32 ++ .section ".text" ++ .align 2 ++ .globl codeSnippet ++ .type codeSnippet, @function ++codeSnippet: ++.LFB2: ++ .cfi_startproc ++.LCF2: ++0: addis 2,12,.TOC.-.LCF2@ha ++ addi 2,2,.TOC.-.LCF2@l ++ .localentry codeSnippet,.-codeSnippet ++ std 31,-8(1) ++ stdu 1,-96(1) ++ .cfi_def_cfa_offset 96 ++ .cfi_offset 31, -8 ++ mr 31,1 ++ .cfi_def_cfa_register 31 ++ std 3,56(31) ++ mr 9,4 ++ mr 8,5 ++ mr 10,6 ++ stw 9,52(31) ++ mr 9,8 ++ stw 9,48(31) ++ mr 9,10 ++ stb 9,47(31) ++ lwa 9,48(31) ++ sldi 10,9,32 ++ lwa 9,52(31) ++ or 9,10,9 ++ std 9,64(31) ++ lbz 9,47(31) ++ cmpwi 0,9,0 ++ beq 0,.L21 ++ ld 9,64(31) ++ oris 9,9,0x8000 ++ std 9,64(31) ++.L21: ++ ld 9,56(31) ++ std 9,72(31) ++ ld 9,72(31) ++ lis 10,0xe96c ++ ori 10,10,0x18 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,4 ++ lis 10,0xe98c ++ ori 10,10,0x10 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,8 ++ lis 10,0x7d89 ++ ori 10,10,0x3a6 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,12 ++ lis 10,0x4e80 ++ ori 10,10,0x420 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,16 ++ addis 10,2,privateSnippetExecutor@toc@ha ++ addi 10,10,privateSnippetExecutor@toc@l ++ std 10,0(9) ++ ld 9,72(31) ++ addi 9,9,24 ++ ld 10,64(31) ++ std 10,0(9) ++ ld 9,56(31) ++ addi 9,9,32 ++ mr 3,9 ++ addi 1,31,96 ++ .cfi_def_cfa 1, 0 ++ ld 31,-8(1) ++ blr ++ .long 0 ++ .byte 0,9,0,0,128,1,0,1 ++ .cfi_endproc ++.LFE2: ++ .size codeSnippet,.-codeSnippet ++ .section .note.GNU-stack,"",@progbits + diff --git a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx new file mode 100644 index 000000000000..3efc00f33e34 --- /dev/null +++ b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx @@ -0,0 +1,257 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno.cxx.orig ++++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno.cxx +@@ -28,6 +28,7 @@ + #include + #include + ++#include + #include "bridges/cpp_uno/shared/bridge.hxx" + #include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" + #include "bridges/cpp_uno/shared/types.hxx" +@@ -37,6 +38,11 @@ + #include + #include + ++#ifdef OSL_BIGENDIAN ++#define IS_BIG_ENDIAN 1 ++#else ++#define IS_BIG_ENDIAN 0 ++#endif + + using namespace ::com::sun::star::uno; + +@@ -144,14 +150,14 @@ + case typelib_TypeClass_BYTE: + case typelib_TypeClass_BOOLEAN: + if (ng < ppc64::MAX_GPR_REGS) +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-1)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 7*IS_BIG_ENDIAN); + ng++; + gpreg++; + } + else +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-1)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 7*IS_BIG_ENDIAN); + bOverFlowUsed = true; + } + if (bOverFlowUsed) ovrflw++; +@@ -160,14 +166,14 @@ + case typelib_TypeClass_SHORT: + case typelib_TypeClass_UNSIGNED_SHORT: + if (ng < ppc64::MAX_GPR_REGS) +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-2)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 6*IS_BIG_ENDIAN); + ng++; + gpreg++; + } + else +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-2)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 6*IS_BIG_ENDIAN); + bOverFlowUsed = true; + } + if (bOverFlowUsed) ovrflw++; +@@ -176,14 +182,14 @@ + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + if (ng < ppc64::MAX_GPR_REGS) +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-4)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 4*IS_BIG_ENDIAN); + ng++; + gpreg++; + } + else +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-4)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 4*IS_BIG_ENDIAN); + bOverFlowUsed = true; + } + if (bOverFlowUsed) ovrflw++; +@@ -327,21 +333,25 @@ + } + } + +- +-//================================================================================================== +-static typelib_TypeClass cpp_mediate( +- sal_uInt64 nOffsetAndIndex, ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++# define PARAMSAVE 32 ++#else ++# define PARAMSAVE 48 ++#endif ++ ++extern "C" typelib_TypeClass cpp_mediate( ++ sal_uInt64 nOffsetAndIndex, + void ** gpreg, void ** fpreg, long sp, +- sal_Int64 * pRegisterReturn /* space for register return */ ) +-{ +- OSL_ENSURE( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" ); ++ sal_Int64 * pRegisterReturn /* space for register return */ ) ++{ ++ static_assert(sizeof(sal_Int64)==sizeof(void *), "### unexpected!"); + + sal_Int32 nVtableOffset = (nOffsetAndIndex >> 32); + sal_Int32 nFunctionIndex = (nOffsetAndIndex & 0xFFFFFFFF); + + long sf = *(long*)sp; +- void ** ovrflw = (void**)(sf + 112); +- ++ void ** ovrflw = (void**)(sf + PARAMSAVE + 64); ++ + // gpreg: [ret *], this, [other gpr params] + // fpreg: [fpr params] + // ovrflw: [gpr or fpr params (properly aligned)] +@@ -501,54 +511,52 @@ + return eRet; + } + +-extern "C" void privateSnippetExecutor( ... ) +-{ +- volatile long nOffsetAndIndex; +- +- //mr %r3, %r11 # move into arg1 the 64bit value passed from OOo ++extern "C" void privateSnippetExecutor( ... ); ++#if 0 ++{ ++ sal_uInt64 gpreg[ppc64::MAX_GPR_REGS]; ++ ++ register long r3 asm("r3"); gpreg[0] = r3; ++ register long r4 asm("r4"); gpreg[1] = r4; ++ register long r5 asm("r5"); gpreg[2] = r5; ++ register long r6 asm("r6"); gpreg[3] = r6; ++ register long r7 asm("r7"); gpreg[4] = r7; ++ register long r8 asm("r8"); gpreg[5] = r8; ++ register long r9 asm("r9"); gpreg[6] = r9; ++ register long r10 asm("r10"); gpreg[7] = r10; ++ ++ double fpreg[ppc64::MAX_SSE_REGS]; ++ + __asm__ __volatile__ ( +- "mr %0, 11\n\t" +- : "=r" (nOffsetAndIndex) : ); +- +- sal_uInt64 gpreg[ppc64::MAX_GPR_REGS]; +- double fpreg[ppc64::MAX_SSE_REGS]; +- +- __asm__ __volatile__ ( +- "std 3, 0(%0)\t\n" +- "std 4, 8(%0)\t\n" +- "std 5, 16(%0)\t\n" +- "std 6, 24(%0)\t\n" +- "std 7, 32(%0)\t\n" +- "std 8, 40(%0)\t\n" +- "std 9, 48(%0)\t\n" +- "std 10, 56(%0)\t\n" +- "stfd 1, 0(%1)\t\n" +- "stfd 2, 8(%1)\t\n" +- "stfd 3, 16(%1)\t\n" +- "stfd 4, 24(%1)\t\n" +- "stfd 5, 32(%1)\t\n" +- "stfd 6, 40(%1)\t\n" +- "stfd 7, 48(%1)\t\n" +- "stfd 8, 56(%1)\t\n" +- "stfd 9, 64(%1)\t\n" +- "stfd 10, 72(%1)\t\n" +- "stfd 11, 80(%1)\t\n" +- "stfd 12, 88(%1)\t\n" +- "stfd 13, 96(%1)\t\n" +- : : "r" (gpreg), "r" (fpreg) +- : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", +- "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", ++ "stfd 1, 0(%0)\t\n" ++ "stfd 2, 8(%0)\t\n" ++ "stfd 3, 16(%0)\t\n" ++ "stfd 4, 24(%0)\t\n" ++ "stfd 5, 32(%0)\t\n" ++ "stfd 6, 40(%0)\t\n" ++ "stfd 7, 48(%0)\t\n" ++ "stfd 8, 56(%0)\t\n" ++ "stfd 9, 64(%0)\t\n" ++ "stfd 10, 72(%0)\t\n" ++ "stfd 11, 80(%0)\t\n" ++ "stfd 12, 88(%0)\t\n" ++ "stfd 13, 96(%0)\t\n" ++ : : "r" (fpreg) ++ : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", + "fr10", "fr11", "fr12", "fr13" + ); + +- volatile long sp; +- +- //stack pointer +- __asm__ __volatile__ ( +- "mr %0, 1\n\t" +- : "=r" (sp) : ); +- ++ register long r11 asm("r11"); ++ const long nOffsetAndIndex = r11; ++ ++ register long r1 asm("r1"); ++ const long sp = r1; ++ ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ volatile long nRegReturn[2]; ++#else + volatile long nRegReturn[1]; ++#endif + + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, sp, (sal_Int64*)nRegReturn); +@@ -591,11 +599,20 @@ + default: + __asm__( "ld 3,%0\n\t" + : : "m" (nRegReturn[0]) ); ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ __asm__( "ld 4,%0\n\t" ++ : : "m" (nRegReturn[1]) ); ++#endif + break; + } + } +- ++#endif ++ ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++const int codeSnippetSize = 32; ++#else + const int codeSnippetSize = 24; ++#endif + + unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, + bool simpleRetType) +@@ -609,10 +626,22 @@ + + if ( !simpleRetType ) + nOffsetAndIndex |= 0x80000000; +- ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ unsigned int *raw = (unsigned int *)&code[0]; ++ ++ raw[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */ ++ raw[1] = 0xe98c0010; /* ld 12,1f-0b(12) */ ++ raw[2] = 0x7d8903a6; /* mtctr 12 */ ++ raw[3] = 0x4e800420; /* bctr */ ++ /* 1: .quad function_addr */ ++ /* 2: .quad context */ ++ *(void **)&raw[4] = (void *)privateSnippetExecutor; ++ *(void **)&raw[6] = (void*)nOffsetAndIndex; ++#else + void ** raw = (void **)&code[0]; + memcpy(raw, (char*) privateSnippetExecutor, 16); + raw[2] = (void*) nOffsetAndIndex; ++#endif + #ifdef CMC_DEBUG + fprintf(stderr, "in: offset/index is %x %x %d, %lx\n", + nFunctionIndex, nVtableOffset, !simpleRetType, raw[2]); + diff --git a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk new file mode 100644 index 000000000000..a4be2365fe34 --- /dev/null +++ b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk @@ -0,0 +1,21 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/makefile.mk ++++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/makefile.mk +@@ -53,7 +53,8 @@ + SLOFILES= \ + $(SLO)$/except.obj \ + $(SLO)$/cpp2uno.obj \ +- $(SLO)$/uno2cpp.obj ++ $(SLO)$/uno2cpp.obj \ ++ $(SLO)$/call.obj + + SHL1TARGET= $(TARGET) + +@@ -73,3 +74,7 @@ + # --- Targets ------------------------------------------------------ + + .INCLUDE : target.mk ++ ++$(SLO)$/%.obj: %.s ++ $(CC) -c -o $(SLO)$/$(@:b).o $< ++ touch $@ + diff --git a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx index b36fd8309b2f..20311ea847f2 100644 --- a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx +++ b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx @@ -1,44 +1,110 @@ ---- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx.orig 2020-10-06 14:16:16 UTC +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx.orig +++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx -@@ -35,6 +35,7 @@ namespace CPPU_CURRENT_NAMESPACE +@@ -25,16 +25,64 @@ + + #include + #include ++ ++#include ++#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h ++#define _GLIBCXX_CDTOR_CALLABI ++#endif + #include ++ ++#ifndef CONFIG_CXXABI_H ++#define CONFIG_CXXABI_H ++ ++#define HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO 0 ++#define HAVE_CXXABI_H_CLASS_TYPE_INFO 0 ++#define HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0 ++#define HAVE_CXXABI_H_CXA_EH_GLOBALS 1 ++#define HAVE_CXXABI_H_CXA_EXCEPTION 1 ++#define HAVE_CXXABI_H_CXA_GET_GLOBALS 1 ++#define HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE 1 ++#define HAVE_CXXABI_H_CXA_THROW 0 ++#define HAVE_CXXABI_H_SI_CLASS_TYPE_INFO 0 ++#define HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO 0 ++ ++#endif ++ ++#if !HAVE_CXXABI_H_CLASS_TYPE_INFO ++// , ++// libstdc++-v3/libsupc++/cxxabi.h: ++namespace __cxxabiv1 { ++class __class_type_info: public std::type_info { ++public: ++ explicit __class_type_info(char const * n): type_info(n) {} ++ ~__class_type_info(); ++}; ++} ++#endif ++ ++#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO ++// , ++// libstdc++-v3/libsupc++/cxxabi.h: ++namespace __cxxabiv1 { ++class __si_class_type_info: public __class_type_info { ++public: ++ __class_type_info const * __base_type; ++ explicit __si_class_type_info( ++ char const * n, __class_type_info const *base): ++ __class_type_info(n), __base_type(base) {} ++ ~__si_class_type_info(); ++}; ++} ++#endif + + namespace CPPU_CURRENT_NAMESPACE + { + +- void dummy_can_throw_anything( char const * ); +- ++void dummy_can_throw_anything( char const * ); // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h +#ifdef __GLIBCXX__ struct _Unwind_Exception { unsigned exception_class __attribute__((__mode__(__DI__))); -@@ -63,18 +64,21 @@ struct __cxa_exception +@@ -63,18 +111,21 @@ _Unwind_Exception unwindHeader; }; +#endif /* __GLIBCXX__ */ extern "C" void *__cxa_allocate_exception( -- std::size_t thrown_size ) throw(); -+ size_t thrown_size ); + std::size_t thrown_size ) throw(); extern "C" void __cxa_throw ( void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); +#ifdef __GLIBCXX__ struct __cxa_eh_globals { __cxa_exception *caughtExceptions; unsigned int uncaughtExceptions; }; extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); +#endif /* __GLIBCXX__ */ // ----- -@@ -82,6 +86,10 @@ void raiseException( +@@ -82,11 +133,16 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); //================================================================================================== +#ifndef __GLIBCXX__ +using __cxxabiv1:: __cxa_exception; +#endif /* __GLIBCXX__ */ + void fillUnoException( __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); } + + namespace ppc64 + { +- enum ppclimits { MAX_GPR_REGS = 8, MAX_SSE_REGS = 13 }; ++ enum ppclimits { MAX_GPR_REGS = 8, MAX_SSE_REGS = 13 }; ++ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ); + } + diff --git a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx index 205333ecb78c..3ed19a042123 100644 --- a/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx +++ b/editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx @@ -1,38 +1,409 @@ ---- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx.orig 2019-09-17 22:55:10 UTC +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx.orig +++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx -@@ -42,6 +42,14 @@ using namespace ::com::sun::star::uno; +@@ -26,6 +26,12 @@ + + #include + ++#include ++#include ++#include ++ ++#include ++#include + #include + #include + +@@ -42,10 +48,68 @@ using namespace ::rtl; using namespace ::com::sun::star::uno; +- +-void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn) +#ifdef __GLIBCXX__ +using CPPU_CURRENT_NAMESPACE::__cxa_exception; +using CPPU_CURRENT_NAMESPACE::__cxa_get_globals; +#else +using __cxxabiv1::__cxa_exception; +using __cxxabiv1::__cxa_current_primary_exception; +using __cxxabiv1::__cxa_decrement_exception_refcount; +#endif - - void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn) ++ ++namespace ppc64 { -@@ -448,9 +456,18 @@ static void cpp_call( +- switch (eTypeClass) ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ bool is_complex_struct(const typelib_TypeDescription * type) ++ { ++ const typelib_CompoundTypeDescription * p ++ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type); ++ for (sal_Int32 i = 0; i < p->nMembers; ++i) ++ { ++ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || ++ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) ++ { ++ typelib_TypeDescription * t = 0; ++ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); ++ bool b = is_complex_struct(t); ++ TYPELIB_DANGER_RELEASE(t); ++ if (b) { ++ return true; ++ } ++ } ++ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) ++ return true; ++ } ++ if (p->pBaseTypeDescription != 0) ++ return is_complex_struct(&p->pBaseTypeDescription->aBase); ++ return false; ++ } ++#endif ++ ++ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) ++ { ++ if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) ++ return false; ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) ++ { ++ typelib_TypeDescription * pTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); ++ ++ //A Composite Type not larger than 16 bytes is returned in up to two GPRs ++ bool bRet = pTypeDescr->nSize > 16 || is_complex_struct(pTypeDescr); ++ ++ TYPELIB_DANGER_RELEASE( pTypeDescr ); ++ return bRet; ++ } ++#endif ++ return true; ++ } ++} ++ ++extern "C" void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* pReturnType, void *pRegisterReturn) ++{ ++ switch (pReturnType->eTypeClass) + { + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: +@@ -67,10 +131,23 @@ + break; + case typelib_TypeClass_FLOAT: + *reinterpret_cast( pRegisterReturn ) = dret; +- break; ++ break; + case typelib_TypeClass_DOUBLE: + *reinterpret_cast( pRegisterReturn ) = dret; + break; ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ case typelib_TypeClass_STRUCT: ++ case typelib_TypeClass_EXCEPTION: ++ if (!ppc64::return_in_hidden_param(pReturnType)) ++ { ++ sal_uInt64 *pRegisters = reinterpret_cast(pRegisterReturn); ++ pRegisters[0] = r3; ++ if (pReturnType->pType->nSize > 8) ++ pRegisters[1] = r4; ++ } ++#else ++ (void)r4; ++#endif + default: + break; + } +@@ -79,11 +156,13 @@ + namespace + { + //================================================================================================== +-static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, +- void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, ++extern "C" void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, ++ void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, + sal_uInt64 *pStack, sal_uInt32 nStack, + sal_uInt64 *pGPR, sal_uInt32 nGPR, +- double *pFPR, sal_uInt32 nFPR) ++ double *pFPR, sal_uInt32 nFPR); ++ ++#if 0 + { + // Stack, if used, must be 16-bytes aligned + if ( nStack ) +@@ -99,13 +178,13 @@ + // Let's figure out what is really going on here + { + fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR ); +- for ( int i = 0; i < nGPR; ++i ) ++ for ( sal_uInt32 i = 0; i < nGPR; ++i ) + fprintf( stderr, "0x%lx, ", pGPR[i] ); + fprintf( stderr, "\nFPR's (%d): ", nFPR ); +- for ( int i = 0; i < nFPR; ++i ) +- fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] ); ++ for ( sal_uInt32 i = 0; i < nFPR; ++i ) ++ fprintf( stderr, "0x%lx (%lf), ", (sal_Int64)pFPR[i], pFPR[i] ); + fprintf( stderr, "\nStack (%d): ", nStack ); +- for ( int i = 0; i < nStack; ++i ) ++ for ( sal_uInt32 i = 0; i < nStack; ++i ) + fprintf( stderr, "0x%lx, ", pStack[i] ); + fprintf( stderr, "\n" ); + } +@@ -120,52 +199,40 @@ + pMethod += 8 * nVtableIndex; + pMethod = *((sal_uInt64 *)pMethod); + ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ typedef void (* FunctionCall )(...); ++#else + typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 ); ++#endif + FunctionCall pFunc = (FunctionCall)pMethod; + + volatile double dret; + + // fill registers + __asm__ __volatile__ ( +- "ld 3, 0(%0)\n\t" +- "ld 4, 8(%0)\n\t" +- "ld 5, 16(%0)\n\t" +- "ld 6, 24(%0)\n\t" +- "ld 7, 32(%0)\n\t" +- "ld 8, 40(%0)\n\t" +- "ld 9, 48(%0)\n\t" +- "ld 10, 56(%0)\n\t" +- "lfd 1, 0(%1)\n\t" +- "lfd 2, 8(%1)\n\t" +- "lfd 3, 16(%1)\n\t" +- "lfd 4, 24(%1)\n\t" +- "lfd 5, 32(%1)\n\t" +- "lfd 6, 40(%1)\n\t" +- "lfd 7, 48(%1)\n\t" +- "lfd 8, 56(%1)\n\t" +- "lfd 9, 64(%1)\n\t" +- "lfd 10, 72(%1)\n\t" +- "lfd 11, 80(%1)\n\t" +- "lfd 12, 88(%1)\n\t" +- "lfd 13, 96(%1)\n\t" +- : : "r" (pGPR), "r" (pFPR) +- : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", +- "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", +- "fr10", "fr11", "fr12", "fr13" ++ "lfd 1, 0(%0)\n\t" ++ "lfd 2, 8(%0)\n\t" ++ "lfd 3, 16(%0)\n\t" ++ "lfd 4, 24(%0)\n\t" ++ "lfd 5, 32(%0)\n\t" ++ "lfd 6, 40(%0)\n\t" ++ "lfd 7, 48(%0)\n\t" ++ "lfd 8, 56(%0)\n\t" ++ "lfd 9, 64(%0)\n\t" ++ "lfd 10, 72(%0)\n\t" ++ "lfd 11, 80(%0)\n\t" ++ "lfd 12, 88(%0)\n\t" ++ "lfd 13, 96(%0)\n\t" ++ : : "r" (pFPR) ++ : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", ++ "fr10", "fr11", "fr12", "fr13" + ); + + // tell gcc that r3 to r11 are not available to it for doing the TOC and exception munge on the func call + register sal_uInt64 r3 asm("r3"); + register sal_uInt64 r4 asm("r4"); +- register sal_uInt64 r5 asm("r5"); +- register sal_uInt64 r6 asm("r6"); +- register sal_uInt64 r7 asm("r7"); +- register sal_uInt64 r8 asm("r8"); +- register sal_uInt64 r9 asm("r9"); +- register sal_uInt64 r10 asm("r10"); +- register sal_uInt64 r11 asm("r11"); +- +- (*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10); ++ ++ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], pGPR[7]); + + // get return value + __asm__ __volatile__ ( +@@ -174,8 +241,9 @@ + "fmr %0, 1\n\t" + : "=f" (dret), "=r" (r3), "=r" (r4) : ); + +- MapReturn(r3, dret, pReturnTypeDescr->eTypeClass, pRegisterReturn); ++ MapReturn(r3, r4, dret, reinterpret_cast(pReturnTypeDescr), pRegisterReturn); + } ++#endif + + // Macros for easier insertion of values to registers or stack + // pSV - pointer to the source +@@ -185,23 +253,35 @@ + + // The value in %xmm register is already prepared to be retrieved as a float, + // thus we treat float and double the same +-#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \ +- if ( nr < ppc64::MAX_SSE_REGS ) \ ++#define INSERT_FLOAT( pSV, nr, pFPR, nGPR, pDS, bOverFlow ) \ ++ if ( nGPR < ppc64::MAX_GPR_REGS ) \ ++ ++nGPR; \ ++ if ( nr < ppc64::MAX_SSE_REGS ) \ + pFPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +- bOverFlow = true; \ ++ bOverFlow = true; \ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); // verbatim! + +-#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \ +- if ( nr < ppc64::MAX_SSE_REGS ) \ ++#define INSERT_DOUBLE( pSV, nr, pFPR, nGPR, pDS, bOverFlow ) \ ++ if ( nGPR < ppc64::MAX_GPR_REGS ) \ ++ ++nGPR; \ ++ if ( nr < ppc64::MAX_SSE_REGS ) \ + pFPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +- bOverFlow = true; \ ++ bOverFlow = true; \ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); // verbatim! + +-#define INSERT_INT64( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT64( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT64( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -209,7 +289,15 @@ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); + +-#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT32( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -217,7 +305,15 @@ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); + +-#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT16( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -225,7 +321,15 @@ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); + +-#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT8( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -337,19 +441,23 @@ + INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); + break; + case typelib_TypeClass_SHORT: ++ INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); ++ break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); + break; + case typelib_TypeClass_BOOLEAN: ++ INSERT_UINT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); ++ break; + case typelib_TypeClass_BYTE: + INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); + break; + case typelib_TypeClass_FLOAT: +- INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow ); +- break; ++ INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverFlow ); ++ break; + case typelib_TypeClass_DOUBLE: +- INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow ); ++ INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverFlow ); + break; + } + +@@ -448,9 +556,18 @@ } catch (...) { + __cxa_exception *header; +#ifdef __GLIBCXX__ + header = __cxa_get_globals()->caughtExceptions; +#else + header = reinterpret_cast<__cxa_exception *>( __cxa_current_primary_exception() ); + if (header) { + __cxa_decrement_exception_refcount( header ); + header--; + } +#endif // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, - *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); + CPPU_CURRENT_NAMESPACE::fillUnoException( header, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); // temporary params for ( ; nTempIndizes--; ) +@@ -475,8 +592,8 @@ + void * pReturn, void * pArgs[], uno_Any ** ppException ) + { + // is my surrogate +- bridges::cpp_uno::shared::UnoInterfaceProxy * pThis +- = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); ++ ::bridges::cpp_uno::shared::UnoInterfaceProxy * pThis ++ = static_cast< ::bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); + typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; + + switch (pMemberDescr->eTypeClass) +@@ -484,8 +601,8 @@ + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + +- VtableSlot aVtableSlot( +- getVtableSlot( ++ ::bridges::cpp_uno::shared::VtableSlot aVtableSlot( ++ ::bridges::cpp_uno::shared::getVtableSlot( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription const * >( + pMemberDescr))); +@@ -529,8 +646,8 @@ + case typelib_TypeClass_INTERFACE_METHOD: + { + +- VtableSlot aVtableSlot( +- getVtableSlot( ++ ::bridges::cpp_uno::shared::VtableSlot aVtableSlot( ++ ::bridges::cpp_uno::shared::getVtableSlot( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription const * >( + pMemberDescr))); + diff --git a/editors/openoffice-4/files/patch-set_soenv.in b/editors/openoffice-4/files/patch-set_soenv.in new file mode 100644 index 000000000000..a5072d9bcb71 --- /dev/null +++ b/editors/openoffice-4/files/patch-set_soenv.in @@ -0,0 +1,67 @@ +--- set_soenv.in 2021-04-02 08:58:22.000000000 -0400 ++++ set_soenv.in 2021-04-17 14:43:53.000000000 -0400 +@@ -408,46 +403,26 @@ + $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads"; + $EPM_FLAGS = "-a arm"; + } +- elsif ($platform =~ m/^powerpc/) +- { +- if (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) { +- print "Setting FreeBSD PPC64 specific values... "; +- $outfile = "FreeBSDPPC64Env.Set"; +- $OUTPATH = "unxfbsdppc64"; +- $CPUNAME = "POWERPC64"; +- +- if ( $JDK eq "gcj" ) { +- $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64"; +- $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."client"; +- $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads"; +- } +- } +- else { +- print "Setting FreeBSD PPC specific values... "; +- $outfile = "FreeBSDPPCEnv.Set"; +- $OUTPATH = "unxlngppc"; +- $CPUNAME = "POWERPC"; +- +- if ( $JDK eq "gcj" ) { +- $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; +- $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client"; +- $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; } +- elsif ($JDK =~ m/^[Ii][Bb][Mm]/) +- { $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; +- $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic"; +- $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; +- } +- # OpenJDK +- elsif ($JDK =~ m/sun/) { +- $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; +- $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."server"; +- $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; +- } +- } +- ++ elsif (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) ++ { print "Setting FreeBSD PPC64 specific values... "; ++ $outfile = "FreeBSDPPC64Env.Set"; + $CPU = "P"; +- ++ $CPUNAME = "POWERPC64"; ++ $OUTPATH = "unxfbsdppc64"; ++ $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64"; ++ $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."server"; ++ $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads"; + } ++ elsif ($platform =~ m/powerpc/) ++ { print "Setting FreeBSD PPC specific values... "; ++ $outfile = "FreeBSDPPCEnv.Set"; ++ $CPU = "P"; ++ $CPUNAME = "POWERPC"; ++ $OUTPATH = "unxfbsdppc"; ++ $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; ++ $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client"; ++ $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; ++ } + else + { print "Unsupported FreeBSD architecture: $platform \n"; + exit 1; diff --git a/editors/openoffice-4/files/patch-solenv_inc_unxfbsdp.mk b/editors/openoffice-4/files/patch-solenv_inc_unxfbsdp.mk new file mode 100644 index 000000000000..33bd69b936b4 --- /dev/null +++ b/editors/openoffice-4/files/patch-solenv_inc_unxfbsdp.mk @@ -0,0 +1,34 @@ +--- /dev/null ++++ solenv/inc/unxfbsdp.mk 2024-03-27 19:54:01.799314000 -0400 +@@ -0,0 +1,31 @@ ++#************************************************************** ++# ++# 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 ++# ++# Unless required by applicable law or agreed to in writing, ++# software distributed under the License is distributed on an ++# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ++# KIND, either express or implied. See the License for the ++# specific language governing permissions and limitations ++# under the License. ++# ++#************************************************************** ++ ++ ++ ++# mk file for Unix FreeBSD 64Bit PowerPC using GCC, inherit from ++# ppc and add some flags ++ ++.INCLUDE : unxfbsdppc.mk ++ ++CDEFS+=-DPOWERPC64 ++CFLAGSCXX+=-mminimal-toc ++BUILD64=1 diff --git a/editors/openoffice-4/files/patch-testtools__source__bridgetest__makefile.mk b/editors/openoffice-4/files/patch-testtools__source__bridgetest__makefile.mk new file mode 100644 index 000000000000..5008d38272a0 --- /dev/null +++ b/editors/openoffice-4/files/patch-testtools__source__bridgetest__makefile.mk @@ -0,0 +1,12 @@ +--- testtools/source/bridgetest/makefile.mk.orig ++++ testtools/source/bridgetest/makefile.mk +@@ -134,7 +134,7 @@ + + runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk \ + $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN) +-.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS" || "$(COM)$(OS)$(CPU)"=="GCCFREEBSDP" ++.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS" || "$(OS)$(CPU)"=="FREEBSDP" + @echo "Mac OSX PPC GCC and Solaris fails this test! likely broken UNO bridge. Fix me." + .ELSE + cd $(DLLDEST) && $(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/uno \ + diff --git a/editors/openoffice-devel/files/patch-bridges_Library__cpp__uno.mk b/editors/openoffice-devel/files/patch-bridges_Library__cpp__uno.mk new file mode 100644 index 000000000000..0cfb99f0f40a --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_Library__cpp__uno.mk @@ -0,0 +1,14 @@ +--- bridges/Library_cpp_uno.mk.orig ++++ bridges/Library_cpp_uno.mk +@@ -131,6 +131,10 @@ + bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp \ + )) + ++$(eval $(call gb_Library_add_asmobjects,$(COMNAME)_uno,\ ++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/call \ ++)) ++ + $(eval $(call gb_LinkTarget_set_cxx_optimization, \ + bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno \ + bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp \ + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s new file mode 100644 index 000000000000..f8c5e20e333e --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s @@ -0,0 +1,482 @@ +--- /dev/null ++++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/call.s +@@ -0,0 +1,478 @@ ++ .file "uno_ppc64_asm.cc" ++ .machine power4 ++ .abiversion 2 ++ .section ".text" ++ .align 2 ++ .globl callVirtualMethod ++ .type callVirtualMethod, @function ++callVirtualMethod: ++.LFB0: ++ .cfi_startproc ++.LCF0: ++0: addis 2,12,.TOC.-.LCF0@ha ++ addi 2,2,.TOC.-.LCF0@l ++ .localentry callVirtualMethod,.-callVirtualMethod ++ mflr 0 ++ std 0,16(1) ++ std 31,-8(1) ++ stdu 1,-208(1) ++ .cfi_def_cfa_offset 208 ++ .cfi_offset 65, 16 ++ .cfi_offset 31, -8 ++ mr 31,1 ++ .cfi_def_cfa_register 31 ++ std 3,136(31) ++ std 5,128(31) ++ std 6,120(31) ++ std 7,112(31) ++ std 9,104(31) ++ mr 9,4 ++ stw 9,248(31) ++ mr 9,8 ++ stw 9,280(31) ++ mr 9,10 ++ stw 9,296(31) ++ ld 9,304(31) ++ std 9,96(31) ++ ld 9,-28688(13) ++ std 9,184(31) ++ li 9,0 ++ lwz 9,280(31) ++ cmpwi 0,9,0 ++ beq 0,.L2 ++ lwz 9,280(31) ++ addi 9,9,1 ++ rldicl 9,9,0,32 ++ rlwinm 9,9,0,0,30 ++ stw 9,280(31) ++.L2: ++#ifdef __LITTLE_ENDIAN__ ++ lwz 9,312(31) ++#else ++ lwz 9,316(31) ++#endif ++ cmplwi 0,9,13 ++ ble 0,.L3 ++ li 9,13 ++#ifdef __LITTLE_ENDIAN__ ++ stw 9,312(31) ++#else ++ stw 9,316(31) ++#endif ++.L3: ++ lwz 9,296(31) ++ cmplwi 0,9,8 ++ ble 0,.L4 ++ li 9,8 ++ stw 9,296(31) ++.L4: ++ lwz 9,280(31) ++ slwi 9,9,3 ++ rldicl 9,9,0,32 ++ addi 9,9,15 ++ srdi 9,9,4 ++ sldi 9,9,4 ++ ld 10,0(1) ++ neg 9,9 ++ stdux 10,1,9 ++ addi 9,1,96 ++ addi 9,9,15 ++ srdi 9,9,4 ++ sldi 9,9,4 ++ std 9,160(31) ++ lwz 9,280(31) ++ slwi 9,9,3 ++ rldicl 9,9,0,32 ++ mr 8,9 ++ ld 10,160(31) ++ ld 9,112(31) ++ mr 5,8 ++ mr 4,9 ++ mr 3,10 ++ bl memcpy ++ nop ++ ld 9,136(31) ++ ld 9,0(9) ++ std 9,168(31) ++ lwz 9,248(31) ++ slwi 9,9,3 ++ rldicl 9,9,0,32 ++ mr 10,9 ++ ld 9,168(31) ++ add 9,9,10 ++ std 9,168(31) ++ ld 9,168(31) ++ ld 9,0(9) ++ std 9,168(31) ++ ld 9,168(31) ++ std 9,176(31) ++ ld 9,96(31) ++#APP ++ # 123 "uno_ppc64_asm.cc" 1 ++ lfd 1, 0(9) ++ lfd 2, 8(9) ++ lfd 3, 16(9) ++ lfd 4, 24(9) ++ lfd 5, 32(9) ++ lfd 6, 40(9) ++ lfd 7, 48(9) ++ lfd 8, 56(9) ++ lfd 9, 64(9) ++ lfd 10, 72(9) ++ lfd 11, 80(9) ++ lfd 12, 88(9) ++ lfd 13, 96(9) ++ ++ # 0 "" 2 ++#NO_APP ++ ld 9,104(31) ++ ld 3,0(9) ++ ld 9,104(31) ++ addi 9,9,8 ++ ld 4,0(9) ++ ld 9,104(31) ++ addi 9,9,16 ++ ld 5,0(9) ++ ld 9,104(31) ++ addi 9,9,24 ++ ld 6,0(9) ++ ld 9,104(31) ++ addi 9,9,32 ++ ld 7,0(9) ++ ld 9,104(31) ++ addi 9,9,40 ++ ld 8,0(9) ++ ld 9,104(31) ++ addi 9,9,48 ++ ld 0,0(9) ++ ld 9,104(31) ++ addi 9,9,56 ++ ld 9,0(9) ++ ld 11,176(31) ++ mr 10,9 ++ mr 9,0 ++ std 2,24(1) ++ mr 12,11 ++ mtctr 12 ++ bctrl ++ ld 2,24(1) ++#APP ++ # 149 "uno_ppc64_asm.cc" 1 ++ mr 3, 3 ++ mr 4, 4 ++ fmr 0, 1 ++ ++ # 0 "" 2 ++#NO_APP ++ stfd 0,152(31) ++ mr 9,3 ++ mr 10,4 ++ lfd 0,152(31) ++ ld 7,128(31) ++ ld 6,120(31) ++ fmr 1,0 ++ mr 4,10 ++ mr 3,9 ++ bl MapReturn ++ nop ++ nop ++ ld 9,184(31) ++ ld 10,-28688(13) ++ xor. 9,9,10 ++ li 10,0 ++ beq 0,.L5 ++ bl __stack_chk_fail ++ nop ++.L5: ++ addi 1,31,208 ++ .cfi_def_cfa 1, 0 ++ ld 0,16(1) ++ mtlr 0 ++ ld 31,-8(1) ++ blr ++ .long 0 ++ .byte 0,9,0,1,128,1,0,1 ++ .cfi_endproc ++.LFE0: ++ .size callVirtualMethod,.-callVirtualMethod ++ .section ".toc","aw" ++ .align 3 ++.LC0: ++ .quad .L9 ++ .section ".text" ++ .align 2 ++ .globl privateSnippetExecutor ++ .type privateSnippetExecutor, @function ++privateSnippetExecutor: ++.LFB1: ++ .cfi_startproc ++.LCF1: ++0: addis 2,12,.TOC.-.LCF1@ha ++ addi 2,2,.TOC.-.LCF1@l ++ .localentry privateSnippetExecutor,.-privateSnippetExecutor ++ mflr 0 ++ std 0,16(1) ++ std 31,-8(1) ++ stdu 1,-272(1) ++ .cfi_def_cfa_offset 272 ++ .cfi_offset 65, 16 ++ .cfi_offset 31, -8 ++ mr 31,1 ++ .cfi_def_cfa_register 31 ++ ld 0,-28688(13) ++ std 0,248(31) ++ li 0,0 ++ std 3,80(31) ++ std 4,88(31) ++ std 5,96(31) ++ std 6,104(31) ++ std 7,112(31) ++ std 8,120(31) ++ std 9,128(31) ++ mr 9,10 ++ std 9,136(31) ++ addi 9,31,144 ++#APP ++ # 173 "uno_ppc64_asm.cc" 1 ++ stfd 1, 0(9) ++stfd 2, 8(9) ++stfd 3, 16(9) ++stfd 4, 24(9) ++stfd 5, 32(9) ++stfd 6, 40(9) ++stfd 7, 48(9) ++stfd 8, 56(9) ++stfd 9, 64(9) ++stfd 10, 72(9) ++stfd 11, 80(9) ++stfd 12, 88(9) ++stfd 13, 96(9) ++ ++ # 0 "" 2 ++#NO_APP ++ std 11,48(31) ++ std 1,56(31) ++ ld 9,48(31) ++ addi 7,31,64 ++ addi 8,31,144 ++ addi 10,31,80 ++ ld 6,56(31) ++ mr 5,8 ++ mr 4,10 ++ mr 3,9 ++ bl cpp_mediate ++ nop ++ mr 9,3 ++ stw 9,44(31) ++ lwa 9,44(31) ++ cmplwi 0,9,15 ++ bgt 0,.L7 ++ sldi 10,9,2 ++ addis 8,2,.LC0@toc@ha ++ ld 9,.LC0@toc@l(8) ++ add 9,10,9 ++ lwz 10,0(9) ++ ld 9,.LC0@toc@l(8) ++ extsw 10,10 ++ add 9,10,9 ++ mtctr 9 ++ bctr ++ .p2align 2 ++ .align 2 ++.L9: ++ .long .L19-.L9 ++ .long .L13-.L9 ++ .long .L15-.L9 ++ .long .L15-.L9 ++ .long .L14-.L9 ++ .long .L13-.L9 ++ .long .L12-.L9 ++ .long .L8-.L9 ++ .long .L7-.L9 ++ .long .L7-.L9 ++ .long .L11-.L9 ++ .long .L10-.L9 ++ .long .L7-.L9 ++ .long .L7-.L9 ++ .long .L7-.L9 ++ .long .L8-.L9 ++.L15: ++#APP ++ # 209 "uno_ppc64_asm.cc" 1 ++ lbz 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L13: ++#APP ++ # 214 "uno_ppc64_asm.cc" 1 ++ lhz 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L14: ++#APP ++ # 218 "uno_ppc64_asm.cc" 1 ++ lha 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L8: ++#APP ++ # 223 "uno_ppc64_asm.cc" 1 ++ lwz 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L12: ++#APP ++ # 227 "uno_ppc64_asm.cc" 1 ++ lwa 3,64(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L11: ++ addi 9,31,64 ++#APP ++ # 231 "uno_ppc64_asm.cc" 1 ++ lfs 1,0(9) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L10: ++ addi 9,31,64 ++#APP ++ # 235 "uno_ppc64_asm.cc" 1 ++ lfd 1,0(9) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L7: ++#APP ++ # 239 "uno_ppc64_asm.cc" 1 ++ ld 3,64(31) ++ ++ # 0 "" 2 ++ # 241 "uno_ppc64_asm.cc" 1 ++ ld 4,72(31) ++ ++ # 0 "" 2 ++#NO_APP ++ b .L17 ++.L19: ++ nop ++.L17: ++ nop ++ ld 9,248(31) ++ ld 10,-28688(13) ++ xor. 9,9,10 ++ li 10,0 ++ beq 0,.L18 ++ bl __stack_chk_fail ++ nop ++.L18: ++ addi 1,31,272 ++ .cfi_def_cfa 1, 0 ++ ld 0,16(1) ++ mtlr 0 ++ ld 31,-8(1) ++ blr ++ .long 0 ++ .byte 0,9,0,1,128,1,0,1 ++ .cfi_endproc ++.LFE1: ++ .size privateSnippetExecutor,.-privateSnippetExecutor ++ .section .rodata ++ .align 2 ++ .type _ZL15codeSnippetSize, @object ++ .size _ZL15codeSnippetSize, 4 ++_ZL15codeSnippetSize: ++ .long 32 ++ .section ".text" ++ .align 2 ++ .globl codeSnippet ++ .type codeSnippet, @function ++codeSnippet: ++.LFB2: ++ .cfi_startproc ++.LCF2: ++0: addis 2,12,.TOC.-.LCF2@ha ++ addi 2,2,.TOC.-.LCF2@l ++ .localentry codeSnippet,.-codeSnippet ++ std 31,-8(1) ++ stdu 1,-96(1) ++ .cfi_def_cfa_offset 96 ++ .cfi_offset 31, -8 ++ mr 31,1 ++ .cfi_def_cfa_register 31 ++ std 3,56(31) ++ mr 9,4 ++ mr 8,5 ++ mr 10,6 ++ stw 9,52(31) ++ mr 9,8 ++ stw 9,48(31) ++ mr 9,10 ++ stb 9,47(31) ++ lwa 9,48(31) ++ sldi 10,9,32 ++ lwa 9,52(31) ++ or 9,10,9 ++ std 9,64(31) ++ lbz 9,47(31) ++ cmpwi 0,9,0 ++ beq 0,.L21 ++ ld 9,64(31) ++ oris 9,9,0x8000 ++ std 9,64(31) ++.L21: ++ ld 9,56(31) ++ std 9,72(31) ++ ld 9,72(31) ++ lis 10,0xe96c ++ ori 10,10,0x18 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,4 ++ lis 10,0xe98c ++ ori 10,10,0x10 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,8 ++ lis 10,0x7d89 ++ ori 10,10,0x3a6 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,12 ++ lis 10,0x4e80 ++ ori 10,10,0x420 ++ stw 10,0(9) ++ ld 9,72(31) ++ addi 9,9,16 ++ addis 10,2,privateSnippetExecutor@toc@ha ++ addi 10,10,privateSnippetExecutor@toc@l ++ std 10,0(9) ++ ld 9,72(31) ++ addi 9,9,24 ++ ld 10,64(31) ++ std 10,0(9) ++ ld 9,56(31) ++ addi 9,9,32 ++ mr 3,9 ++ addi 1,31,96 ++ .cfi_def_cfa 1, 0 ++ ld 31,-8(1) ++ blr ++ .long 0 ++ .byte 0,9,0,0,128,1,0,1 ++ .cfi_endproc ++.LFE2: ++ .size codeSnippet,.-codeSnippet ++ .section .note.GNU-stack,"",@progbits + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx new file mode 100644 index 000000000000..3efc00f33e34 --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx @@ -0,0 +1,257 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno.cxx.orig ++++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno.cxx +@@ -28,6 +28,7 @@ + #include + #include + ++#include + #include "bridges/cpp_uno/shared/bridge.hxx" + #include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" + #include "bridges/cpp_uno/shared/types.hxx" +@@ -37,6 +38,11 @@ + #include + #include + ++#ifdef OSL_BIGENDIAN ++#define IS_BIG_ENDIAN 1 ++#else ++#define IS_BIG_ENDIAN 0 ++#endif + + using namespace ::com::sun::star::uno; + +@@ -144,14 +150,14 @@ + case typelib_TypeClass_BYTE: + case typelib_TypeClass_BOOLEAN: + if (ng < ppc64::MAX_GPR_REGS) +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-1)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 7*IS_BIG_ENDIAN); + ng++; + gpreg++; + } + else +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-1)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 7*IS_BIG_ENDIAN); + bOverFlowUsed = true; + } + if (bOverFlowUsed) ovrflw++; +@@ -160,14 +166,14 @@ + case typelib_TypeClass_SHORT: + case typelib_TypeClass_UNSIGNED_SHORT: + if (ng < ppc64::MAX_GPR_REGS) +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-2)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 6*IS_BIG_ENDIAN); + ng++; + gpreg++; + } + else +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-2)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 6*IS_BIG_ENDIAN); + bOverFlowUsed = true; + } + if (bOverFlowUsed) ovrflw++; +@@ -176,14 +182,14 @@ + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + if (ng < ppc64::MAX_GPR_REGS) +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-4)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 4*IS_BIG_ENDIAN); + ng++; + gpreg++; + } + else +- { +- pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-4)); ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 4*IS_BIG_ENDIAN); + bOverFlowUsed = true; + } + if (bOverFlowUsed) ovrflw++; +@@ -327,21 +333,25 @@ + } + } + +- +-//================================================================================================== +-static typelib_TypeClass cpp_mediate( +- sal_uInt64 nOffsetAndIndex, ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++# define PARAMSAVE 32 ++#else ++# define PARAMSAVE 48 ++#endif ++ ++extern "C" typelib_TypeClass cpp_mediate( ++ sal_uInt64 nOffsetAndIndex, + void ** gpreg, void ** fpreg, long sp, +- sal_Int64 * pRegisterReturn /* space for register return */ ) +-{ +- OSL_ENSURE( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" ); ++ sal_Int64 * pRegisterReturn /* space for register return */ ) ++{ ++ static_assert(sizeof(sal_Int64)==sizeof(void *), "### unexpected!"); + + sal_Int32 nVtableOffset = (nOffsetAndIndex >> 32); + sal_Int32 nFunctionIndex = (nOffsetAndIndex & 0xFFFFFFFF); + + long sf = *(long*)sp; +- void ** ovrflw = (void**)(sf + 112); +- ++ void ** ovrflw = (void**)(sf + PARAMSAVE + 64); ++ + // gpreg: [ret *], this, [other gpr params] + // fpreg: [fpr params] + // ovrflw: [gpr or fpr params (properly aligned)] +@@ -501,54 +511,52 @@ + return eRet; + } + +-extern "C" void privateSnippetExecutor( ... ) +-{ +- volatile long nOffsetAndIndex; +- +- //mr %r3, %r11 # move into arg1 the 64bit value passed from OOo ++extern "C" void privateSnippetExecutor( ... ); ++#if 0 ++{ ++ sal_uInt64 gpreg[ppc64::MAX_GPR_REGS]; ++ ++ register long r3 asm("r3"); gpreg[0] = r3; ++ register long r4 asm("r4"); gpreg[1] = r4; ++ register long r5 asm("r5"); gpreg[2] = r5; ++ register long r6 asm("r6"); gpreg[3] = r6; ++ register long r7 asm("r7"); gpreg[4] = r7; ++ register long r8 asm("r8"); gpreg[5] = r8; ++ register long r9 asm("r9"); gpreg[6] = r9; ++ register long r10 asm("r10"); gpreg[7] = r10; ++ ++ double fpreg[ppc64::MAX_SSE_REGS]; ++ + __asm__ __volatile__ ( +- "mr %0, 11\n\t" +- : "=r" (nOffsetAndIndex) : ); +- +- sal_uInt64 gpreg[ppc64::MAX_GPR_REGS]; +- double fpreg[ppc64::MAX_SSE_REGS]; +- +- __asm__ __volatile__ ( +- "std 3, 0(%0)\t\n" +- "std 4, 8(%0)\t\n" +- "std 5, 16(%0)\t\n" +- "std 6, 24(%0)\t\n" +- "std 7, 32(%0)\t\n" +- "std 8, 40(%0)\t\n" +- "std 9, 48(%0)\t\n" +- "std 10, 56(%0)\t\n" +- "stfd 1, 0(%1)\t\n" +- "stfd 2, 8(%1)\t\n" +- "stfd 3, 16(%1)\t\n" +- "stfd 4, 24(%1)\t\n" +- "stfd 5, 32(%1)\t\n" +- "stfd 6, 40(%1)\t\n" +- "stfd 7, 48(%1)\t\n" +- "stfd 8, 56(%1)\t\n" +- "stfd 9, 64(%1)\t\n" +- "stfd 10, 72(%1)\t\n" +- "stfd 11, 80(%1)\t\n" +- "stfd 12, 88(%1)\t\n" +- "stfd 13, 96(%1)\t\n" +- : : "r" (gpreg), "r" (fpreg) +- : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", +- "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", ++ "stfd 1, 0(%0)\t\n" ++ "stfd 2, 8(%0)\t\n" ++ "stfd 3, 16(%0)\t\n" ++ "stfd 4, 24(%0)\t\n" ++ "stfd 5, 32(%0)\t\n" ++ "stfd 6, 40(%0)\t\n" ++ "stfd 7, 48(%0)\t\n" ++ "stfd 8, 56(%0)\t\n" ++ "stfd 9, 64(%0)\t\n" ++ "stfd 10, 72(%0)\t\n" ++ "stfd 11, 80(%0)\t\n" ++ "stfd 12, 88(%0)\t\n" ++ "stfd 13, 96(%0)\t\n" ++ : : "r" (fpreg) ++ : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", + "fr10", "fr11", "fr12", "fr13" + ); + +- volatile long sp; +- +- //stack pointer +- __asm__ __volatile__ ( +- "mr %0, 1\n\t" +- : "=r" (sp) : ); +- ++ register long r11 asm("r11"); ++ const long nOffsetAndIndex = r11; ++ ++ register long r1 asm("r1"); ++ const long sp = r1; ++ ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ volatile long nRegReturn[2]; ++#else + volatile long nRegReturn[1]; ++#endif + + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, sp, (sal_Int64*)nRegReturn); +@@ -591,11 +599,20 @@ + default: + __asm__( "ld 3,%0\n\t" + : : "m" (nRegReturn[0]) ); ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ __asm__( "ld 4,%0\n\t" ++ : : "m" (nRegReturn[1]) ); ++#endif + break; + } + } +- ++#endif ++ ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++const int codeSnippetSize = 32; ++#else + const int codeSnippetSize = 24; ++#endif + + unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, + bool simpleRetType) +@@ -609,10 +626,22 @@ + + if ( !simpleRetType ) + nOffsetAndIndex |= 0x80000000; +- ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ unsigned int *raw = (unsigned int *)&code[0]; ++ ++ raw[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */ ++ raw[1] = 0xe98c0010; /* ld 12,1f-0b(12) */ ++ raw[2] = 0x7d8903a6; /* mtctr 12 */ ++ raw[3] = 0x4e800420; /* bctr */ ++ /* 1: .quad function_addr */ ++ /* 2: .quad context */ ++ *(void **)&raw[4] = (void *)privateSnippetExecutor; ++ *(void **)&raw[6] = (void*)nOffsetAndIndex; ++#else + void ** raw = (void **)&code[0]; + memcpy(raw, (char*) privateSnippetExecutor, 16); + raw[2] = (void*) nOffsetAndIndex; ++#endif + #ifdef CMC_DEBUG + fprintf(stderr, "in: offset/index is %x %x %d, %lx\n", + nFunctionIndex, nVtableOffset, !simpleRetType, raw[2]); + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk new file mode 100644 index 000000000000..a4be2365fe34 --- /dev/null +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk @@ -0,0 +1,21 @@ +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/makefile.mk ++++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/makefile.mk +@@ -53,7 +53,8 @@ + SLOFILES= \ + $(SLO)$/except.obj \ + $(SLO)$/cpp2uno.obj \ +- $(SLO)$/uno2cpp.obj ++ $(SLO)$/uno2cpp.obj \ ++ $(SLO)$/call.obj + + SHL1TARGET= $(TARGET) + +@@ -73,3 +74,7 @@ + # --- Targets ------------------------------------------------------ + + .INCLUDE : target.mk ++ ++$(SLO)$/%.obj: %.s ++ $(CC) -c -o $(SLO)$/$(@:b).o $< ++ touch $@ + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx index 7b230a1dbb81..20311ea847f2 100644 --- a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx @@ -1,44 +1,110 @@ ---- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx.orig 2019-09-17 22:55:10 UTC +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx.orig +++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx -@@ -35,6 +35,7 @@ namespace CPPU_CURRENT_NAMESPACE +@@ -25,16 +25,64 @@ + + #include + #include ++ ++#include ++#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h ++#define _GLIBCXX_CDTOR_CALLABI ++#endif + #include ++ ++#ifndef CONFIG_CXXABI_H ++#define CONFIG_CXXABI_H ++ ++#define HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO 0 ++#define HAVE_CXXABI_H_CLASS_TYPE_INFO 0 ++#define HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0 ++#define HAVE_CXXABI_H_CXA_EH_GLOBALS 1 ++#define HAVE_CXXABI_H_CXA_EXCEPTION 1 ++#define HAVE_CXXABI_H_CXA_GET_GLOBALS 1 ++#define HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE 1 ++#define HAVE_CXXABI_H_CXA_THROW 0 ++#define HAVE_CXXABI_H_SI_CLASS_TYPE_INFO 0 ++#define HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO 0 ++ ++#endif ++ ++#if !HAVE_CXXABI_H_CLASS_TYPE_INFO ++// , ++// libstdc++-v3/libsupc++/cxxabi.h: ++namespace __cxxabiv1 { ++class __class_type_info: public std::type_info { ++public: ++ explicit __class_type_info(char const * n): type_info(n) {} ++ ~__class_type_info(); ++}; ++} ++#endif ++ ++#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO ++// , ++// libstdc++-v3/libsupc++/cxxabi.h: ++namespace __cxxabiv1 { ++class __si_class_type_info: public __class_type_info { ++public: ++ __class_type_info const * __base_type; ++ explicit __si_class_type_info( ++ char const * n, __class_type_info const *base): ++ __class_type_info(n), __base_type(base) {} ++ ~__si_class_type_info(); ++}; ++} ++#endif + + namespace CPPU_CURRENT_NAMESPACE + { + +- void dummy_can_throw_anything( char const * ); +- ++void dummy_can_throw_anything( char const * ); // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h +#ifdef __GLIBCXX__ struct _Unwind_Exception { unsigned exception_class __attribute__((__mode__(__DI__))); -@@ -63,18 +64,21 @@ struct __cxa_exception +@@ -63,18 +111,21 @@ _Unwind_Exception unwindHeader; }; +#endif /* __GLIBCXX__ */ extern "C" void *__cxa_allocate_exception( -- std::size_t thrown_size ) throw(); -+ size_t thrown_size ); + std::size_t thrown_size ) throw(); extern "C" void __cxa_throw ( void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); +#ifdef __GLIBCXX__ struct __cxa_eh_globals { __cxa_exception *caughtExceptions; unsigned int uncaughtExceptions; }; extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); +#endif /* __GLIBCXX__ */ // ----- -@@ -82,6 +86,10 @@ void raiseException( +@@ -82,11 +133,16 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); //================================================================================================== +#ifndef __GLIBCXX__ +using __cxxabiv1:: __cxa_exception; +#endif /* __GLIBCXX__ */ + void fillUnoException( __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); } + + namespace ppc64 + { +- enum ppclimits { MAX_GPR_REGS = 8, MAX_SSE_REGS = 13 }; ++ enum ppclimits { MAX_GPR_REGS = 8, MAX_SSE_REGS = 13 }; ++ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ); + } + diff --git a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx index 205333ecb78c..3ed19a042123 100644 --- a/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx +++ b/editors/openoffice-devel/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx @@ -1,38 +1,409 @@ ---- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx.orig 2019-09-17 22:55:10 UTC +--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx.orig +++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx -@@ -42,6 +42,14 @@ using namespace ::com::sun::star::uno; +@@ -26,6 +26,12 @@ + + #include + ++#include ++#include ++#include ++ ++#include ++#include + #include + #include + +@@ -42,10 +48,68 @@ using namespace ::rtl; using namespace ::com::sun::star::uno; +- +-void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn) +#ifdef __GLIBCXX__ +using CPPU_CURRENT_NAMESPACE::__cxa_exception; +using CPPU_CURRENT_NAMESPACE::__cxa_get_globals; +#else +using __cxxabiv1::__cxa_exception; +using __cxxabiv1::__cxa_current_primary_exception; +using __cxxabiv1::__cxa_decrement_exception_refcount; +#endif - - void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn) ++ ++namespace ppc64 { -@@ -448,9 +456,18 @@ static void cpp_call( +- switch (eTypeClass) ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ bool is_complex_struct(const typelib_TypeDescription * type) ++ { ++ const typelib_CompoundTypeDescription * p ++ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type); ++ for (sal_Int32 i = 0; i < p->nMembers; ++i) ++ { ++ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || ++ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) ++ { ++ typelib_TypeDescription * t = 0; ++ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); ++ bool b = is_complex_struct(t); ++ TYPELIB_DANGER_RELEASE(t); ++ if (b) { ++ return true; ++ } ++ } ++ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) ++ return true; ++ } ++ if (p->pBaseTypeDescription != 0) ++ return is_complex_struct(&p->pBaseTypeDescription->aBase); ++ return false; ++ } ++#endif ++ ++ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) ++ { ++ if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) ++ return false; ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) ++ { ++ typelib_TypeDescription * pTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); ++ ++ //A Composite Type not larger than 16 bytes is returned in up to two GPRs ++ bool bRet = pTypeDescr->nSize > 16 || is_complex_struct(pTypeDescr); ++ ++ TYPELIB_DANGER_RELEASE( pTypeDescr ); ++ return bRet; ++ } ++#endif ++ return true; ++ } ++} ++ ++extern "C" void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* pReturnType, void *pRegisterReturn) ++{ ++ switch (pReturnType->eTypeClass) + { + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: +@@ -67,10 +131,23 @@ + break; + case typelib_TypeClass_FLOAT: + *reinterpret_cast( pRegisterReturn ) = dret; +- break; ++ break; + case typelib_TypeClass_DOUBLE: + *reinterpret_cast( pRegisterReturn ) = dret; + break; ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ case typelib_TypeClass_STRUCT: ++ case typelib_TypeClass_EXCEPTION: ++ if (!ppc64::return_in_hidden_param(pReturnType)) ++ { ++ sal_uInt64 *pRegisters = reinterpret_cast(pRegisterReturn); ++ pRegisters[0] = r3; ++ if (pReturnType->pType->nSize > 8) ++ pRegisters[1] = r4; ++ } ++#else ++ (void)r4; ++#endif + default: + break; + } +@@ -79,11 +156,13 @@ + namespace + { + //================================================================================================== +-static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, +- void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, ++extern "C" void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, ++ void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, + sal_uInt64 *pStack, sal_uInt32 nStack, + sal_uInt64 *pGPR, sal_uInt32 nGPR, +- double *pFPR, sal_uInt32 nFPR) ++ double *pFPR, sal_uInt32 nFPR); ++ ++#if 0 + { + // Stack, if used, must be 16-bytes aligned + if ( nStack ) +@@ -99,13 +178,13 @@ + // Let's figure out what is really going on here + { + fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR ); +- for ( int i = 0; i < nGPR; ++i ) ++ for ( sal_uInt32 i = 0; i < nGPR; ++i ) + fprintf( stderr, "0x%lx, ", pGPR[i] ); + fprintf( stderr, "\nFPR's (%d): ", nFPR ); +- for ( int i = 0; i < nFPR; ++i ) +- fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] ); ++ for ( sal_uInt32 i = 0; i < nFPR; ++i ) ++ fprintf( stderr, "0x%lx (%lf), ", (sal_Int64)pFPR[i], pFPR[i] ); + fprintf( stderr, "\nStack (%d): ", nStack ); +- for ( int i = 0; i < nStack; ++i ) ++ for ( sal_uInt32 i = 0; i < nStack; ++i ) + fprintf( stderr, "0x%lx, ", pStack[i] ); + fprintf( stderr, "\n" ); + } +@@ -120,52 +199,40 @@ + pMethod += 8 * nVtableIndex; + pMethod = *((sal_uInt64 *)pMethod); + ++#if defined(_CALL_ELF) && _CALL_ELF == 2 ++ typedef void (* FunctionCall )(...); ++#else + typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 ); ++#endif + FunctionCall pFunc = (FunctionCall)pMethod; + + volatile double dret; + + // fill registers + __asm__ __volatile__ ( +- "ld 3, 0(%0)\n\t" +- "ld 4, 8(%0)\n\t" +- "ld 5, 16(%0)\n\t" +- "ld 6, 24(%0)\n\t" +- "ld 7, 32(%0)\n\t" +- "ld 8, 40(%0)\n\t" +- "ld 9, 48(%0)\n\t" +- "ld 10, 56(%0)\n\t" +- "lfd 1, 0(%1)\n\t" +- "lfd 2, 8(%1)\n\t" +- "lfd 3, 16(%1)\n\t" +- "lfd 4, 24(%1)\n\t" +- "lfd 5, 32(%1)\n\t" +- "lfd 6, 40(%1)\n\t" +- "lfd 7, 48(%1)\n\t" +- "lfd 8, 56(%1)\n\t" +- "lfd 9, 64(%1)\n\t" +- "lfd 10, 72(%1)\n\t" +- "lfd 11, 80(%1)\n\t" +- "lfd 12, 88(%1)\n\t" +- "lfd 13, 96(%1)\n\t" +- : : "r" (pGPR), "r" (pFPR) +- : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", +- "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", +- "fr10", "fr11", "fr12", "fr13" ++ "lfd 1, 0(%0)\n\t" ++ "lfd 2, 8(%0)\n\t" ++ "lfd 3, 16(%0)\n\t" ++ "lfd 4, 24(%0)\n\t" ++ "lfd 5, 32(%0)\n\t" ++ "lfd 6, 40(%0)\n\t" ++ "lfd 7, 48(%0)\n\t" ++ "lfd 8, 56(%0)\n\t" ++ "lfd 9, 64(%0)\n\t" ++ "lfd 10, 72(%0)\n\t" ++ "lfd 11, 80(%0)\n\t" ++ "lfd 12, 88(%0)\n\t" ++ "lfd 13, 96(%0)\n\t" ++ : : "r" (pFPR) ++ : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", ++ "fr10", "fr11", "fr12", "fr13" + ); + + // tell gcc that r3 to r11 are not available to it for doing the TOC and exception munge on the func call + register sal_uInt64 r3 asm("r3"); + register sal_uInt64 r4 asm("r4"); +- register sal_uInt64 r5 asm("r5"); +- register sal_uInt64 r6 asm("r6"); +- register sal_uInt64 r7 asm("r7"); +- register sal_uInt64 r8 asm("r8"); +- register sal_uInt64 r9 asm("r9"); +- register sal_uInt64 r10 asm("r10"); +- register sal_uInt64 r11 asm("r11"); +- +- (*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10); ++ ++ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], pGPR[7]); + + // get return value + __asm__ __volatile__ ( +@@ -174,8 +241,9 @@ + "fmr %0, 1\n\t" + : "=f" (dret), "=r" (r3), "=r" (r4) : ); + +- MapReturn(r3, dret, pReturnTypeDescr->eTypeClass, pRegisterReturn); ++ MapReturn(r3, r4, dret, reinterpret_cast(pReturnTypeDescr), pRegisterReturn); + } ++#endif + + // Macros for easier insertion of values to registers or stack + // pSV - pointer to the source +@@ -185,23 +253,35 @@ + + // The value in %xmm register is already prepared to be retrieved as a float, + // thus we treat float and double the same +-#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \ +- if ( nr < ppc64::MAX_SSE_REGS ) \ ++#define INSERT_FLOAT( pSV, nr, pFPR, nGPR, pDS, bOverFlow ) \ ++ if ( nGPR < ppc64::MAX_GPR_REGS ) \ ++ ++nGPR; \ ++ if ( nr < ppc64::MAX_SSE_REGS ) \ + pFPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +- bOverFlow = true; \ ++ bOverFlow = true; \ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); // verbatim! + +-#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \ +- if ( nr < ppc64::MAX_SSE_REGS ) \ ++#define INSERT_DOUBLE( pSV, nr, pFPR, nGPR, pDS, bOverFlow ) \ ++ if ( nGPR < ppc64::MAX_GPR_REGS ) \ ++ ++nGPR; \ ++ if ( nr < ppc64::MAX_SSE_REGS ) \ + pFPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +- bOverFlow = true; \ ++ bOverFlow = true; \ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); // verbatim! + +-#define INSERT_INT64( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT64( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT64( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -209,7 +289,15 @@ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); + +-#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT32( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -217,7 +305,15 @@ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); + +-#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT16( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -225,7 +321,15 @@ + if (bOverFlow) \ + *pDS++ = *reinterpret_cast( pSV ); + +-#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverflow ) \ ++#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverFlow ) \ ++ if ( nr < ppc64::MAX_GPR_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast( pSV ); \ ++ else \ ++ bOverFlow = true; \ ++ if (bOverFlow) \ ++ *pDS++ = *reinterpret_cast( pSV ); ++ ++#define INSERT_UINT8( pSV, nr, pGPR, pDS, bOverFlow ) \ + if ( nr < ppc64::MAX_GPR_REGS ) \ + pGPR[nr++] = *reinterpret_cast( pSV ); \ + else \ +@@ -337,19 +441,23 @@ + INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); + break; + case typelib_TypeClass_SHORT: ++ INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); ++ break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); + break; + case typelib_TypeClass_BOOLEAN: ++ INSERT_UINT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); ++ break; + case typelib_TypeClass_BYTE: + INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); + break; + case typelib_TypeClass_FLOAT: +- INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow ); +- break; ++ INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverFlow ); ++ break; + case typelib_TypeClass_DOUBLE: +- INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow ); ++ INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverFlow ); + break; + } + +@@ -448,9 +556,18 @@ } catch (...) { + __cxa_exception *header; +#ifdef __GLIBCXX__ + header = __cxa_get_globals()->caughtExceptions; +#else + header = reinterpret_cast<__cxa_exception *>( __cxa_current_primary_exception() ); + if (header) { + __cxa_decrement_exception_refcount( header ); + header--; + } +#endif // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, - *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); + CPPU_CURRENT_NAMESPACE::fillUnoException( header, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); // temporary params for ( ; nTempIndizes--; ) +@@ -475,8 +592,8 @@ + void * pReturn, void * pArgs[], uno_Any ** ppException ) + { + // is my surrogate +- bridges::cpp_uno::shared::UnoInterfaceProxy * pThis +- = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); ++ ::bridges::cpp_uno::shared::UnoInterfaceProxy * pThis ++ = static_cast< ::bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); + typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; + + switch (pMemberDescr->eTypeClass) +@@ -484,8 +601,8 @@ + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + +- VtableSlot aVtableSlot( +- getVtableSlot( ++ ::bridges::cpp_uno::shared::VtableSlot aVtableSlot( ++ ::bridges::cpp_uno::shared::getVtableSlot( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription const * >( + pMemberDescr))); +@@ -529,8 +646,8 @@ + case typelib_TypeClass_INTERFACE_METHOD: + { + +- VtableSlot aVtableSlot( +- getVtableSlot( ++ ::bridges::cpp_uno::shared::VtableSlot aVtableSlot( ++ ::bridges::cpp_uno::shared::getVtableSlot( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription const * >( + pMemberDescr))); + diff --git a/editors/openoffice-devel/files/patch-solenv_inc_unxfbsdp.mk b/editors/openoffice-devel/files/patch-solenv_inc_unxfbsdp.mk new file mode 100644 index 000000000000..33bd69b936b4 --- /dev/null +++ b/editors/openoffice-devel/files/patch-solenv_inc_unxfbsdp.mk @@ -0,0 +1,34 @@ +--- /dev/null ++++ solenv/inc/unxfbsdp.mk 2024-03-27 19:54:01.799314000 -0400 +@@ -0,0 +1,31 @@ ++#************************************************************** ++# ++# 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 ++# ++# Unless required by applicable law or agreed to in writing, ++# software distributed under the License is distributed on an ++# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ++# KIND, either express or implied. See the License for the ++# specific language governing permissions and limitations ++# under the License. ++# ++#************************************************************** ++ ++ ++ ++# mk file for Unix FreeBSD 64Bit PowerPC using GCC, inherit from ++# ppc and add some flags ++ ++.INCLUDE : unxfbsdppc.mk ++ ++CDEFS+=-DPOWERPC64 ++CFLAGSCXX+=-mminimal-toc ++BUILD64=1 diff --git a/editors/openoffice-devel/files/patch-testtools__source__bridgetest__makefile.mk b/editors/openoffice-devel/files/patch-testtools__source__bridgetest__makefile.mk new file mode 100644 index 000000000000..5008d38272a0 --- /dev/null +++ b/editors/openoffice-devel/files/patch-testtools__source__bridgetest__makefile.mk @@ -0,0 +1,12 @@ +--- testtools/source/bridgetest/makefile.mk.orig ++++ testtools/source/bridgetest/makefile.mk +@@ -134,7 +134,7 @@ + + runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk \ + $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN) +-.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS" || "$(COM)$(OS)$(CPU)"=="GCCFREEBSDP" ++.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS" || "$(OS)$(CPU)"=="FREEBSDP" + @echo "Mac OSX PPC GCC and Solaris fails this test! likely broken UNO bridge. Fix me." + .ELSE + cd $(DLLDEST) && $(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/uno \ +