[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) New commits: commit 3120273ab10e9e8b765e2d13a90b62102a45c56f Author: Stephan Bergmann sberg...@redhat.com Date: Mon Apr 23 14:28:48 2012 +0200 Port gcc3_linux_powerpc fix to gcc3_macosx_powerpc This ports 84dbc4fe2547f8fc341a46d7f000e721c81e63ee do not let gcc use registers we are setting ourselves, in the hope that it is also an improvement for Mac OS X PPC. (But the patch was applied blindly, so please revert if it makes things worse instead.) diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx index 59cec3c..0750980 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx @@ -67,7 +67,6 @@ static void callVirtualMethod( // of floating point registers f1 to f13 unsigned long * mfunc;// actual function to be invoked - void (*ptr)(); int gpr[8]; // storage for gpregisters, map to r3-r10 int off; // offset used to find function double fpr[13]; // storage for fpregisters, map to f1-f13 @@ -208,7 +207,8 @@ static void callVirtualMethod( mfunc = *((unsigned long **)pAdjustedThisPtr);// get the address of the vtable mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset mfunc = *((unsigned long **)mfunc); // the function is stored at the address - ptr = (void (*)())mfunc; + typedef void (*FunctionCall)(sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32); + FunctionCall ptr = (FunctionCall)mfunc; /* Set up the machine registers and invoke the function */ @@ -240,7 +240,17 @@ static void callVirtualMethod( f10, f11, f12, f13 ); -(*ptr)(); +// tell gcc that r3 to r10 are not available to it for doing the TOC and exception munge on the func call +register sal_uInt32 r3 __asm__(r3); +register sal_uInt32 r4 __asm__(r4); +register sal_uInt32 r5 __asm__(r5); +register sal_uInt32 r6 __asm__(r6); +register sal_uInt32 r7 __asm__(r7); +register sal_uInt32 r8 __asm__(r8); +register sal_uInt32 r9 __asm__(r9); +register sal_uInt32 r10 __asm__(r10); + +(*ptr)(r3, r4, r5, r6, r7, r8, r9, r10); __asm__ __volatile__ ( ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e0be9a035a82131628ad07ae05be8bf322730f66 Author: Tor Lillqvist t...@iki.fi Date: Sun Apr 22 20:11:30 2012 +0300 WaE: variable 'stackptr' is uninitialized when used diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx index c9fd510..8f397d9 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx @@ -80,7 +80,7 @@ void callVirtualMethod( if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything(xxx); // address something volatile long edx = 0, eax = 0; // for register returns -void * stackptr; +void * stackptr = 0; asm volatile ( mov %%esp, %6\n\t mov %0, %%eax\n\t ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx | 154 ++ bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.hxx | 49 +++ bridges/source/cpp_uno/gcc3_linux_intel/except.cxx| 11 bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk |1 bridges/source/cpp_uno/gcc3_linux_intel/share.hxx | 27 + bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx | 126 6 files changed, 233 insertions(+), 135 deletions(-) New commits: commit b0515ea5fa6c29faebed616ae3e0213c72d24904 Author: Stephan Bergmann sberg...@redhat.com Date: Wed Apr 4 13:02:44 2012 +0200 Adapt cpp_uno/gcc3_linux_intel to GCC 4.7 ...the same way cpp_uno/gcc3_linux_x86-64 was already adapted. diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx new file mode 100644 index 000..4c6370f --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * http://www.openoffice.org/license.html + * for a copy of the LGPLv3 License. + * + / + +#include sal/config.h + +#include cassert + +#include cppu/macros.hxx +#include sal/types.h +#include typelib/typeclass.h +#include typelib/typedescription.h + +#include callvirtualmethod.hxx + +// The call instruction within the asm block of callVirtualMethod may throw +// exceptions. At least GCC 4.7.0 with -O0 would create (unnecessary) +// .gcc_exception_table call-site table entries around all other calls in this +// function that can throw, leading to std::terminate if the asm call throws an +// exception and the unwinding C++ personality routine finds the unexpected hole +// in the .gcc_exception_table. Therefore, make sure this function explicitly +// only calls nothrow-functions (so GCC 4.7.0 with -O0 happens to not create a +// .gcc_exception_table section at all for this function). For some reason, +// this also needs to be in a source file of its own. +// +// Also, this file should be compiled with -fnon-call-exceptions, and ideally +// there would be a way to tell the compiler that the asm block contains calls +// to functions that can potentially throw; see the mail thread starting at +// http://gcc.gnu.org/ml/gcc/2012-03/msg00454.html C++: Letting compiler know +// asm block can call function that can throw? + +void CPPU_CURRENT_NAMESPACE::callVirtualMethod( +void * pAdjustedThisPtr, sal_Int32 nVtableIndex, void * pRegisterReturn, +typelib_TypeDescription * pReturnTypeDescr, bool bSimpleReturn, +sal_Int32 * pStackLongs, sal_Int32 nStackLongs) +{ +// parameter list is mixed list of * and values +// reference parameters are pointers + +assert(pStackLongs pAdjustedThisPtr); +assert(sizeof (void *) == 4 sizeof (sal_Int32) == 4); +// unexpected size of int +assert(nStackLongs pStackLongs); // no stack + +volatile long edx = 0, eax = 0; // for register returns +void * stackptr; +asm volatile ( +mov %%esp, %6\n\t +// preserve potential 128bit stack alignment +and $0xfff0, %%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 +dec %%edx\n\t +shl $2, %%edx\n\t +add %1, %%edx\n +Lcopy:\n\t +pushl 0(%%edx)\n\t +sub $4, %%edx\n\t +dec %%eax\n\t +jne Lcopy\n\t +// do the actual call +mov %2, %%edx\n\t +mov 0(%%edx), %%edx\n\t +mov %3, %%eax\n\t +shl $2, %%eax\n\t +add %%eax, %%edx\n\t +mov 0(%%edx), %%edx\n\t +
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.hxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 932f5a4b1f001c11bab8fb10d3be324ded13193f Author: Stephan Bergmann sberg...@redhat.com Date: Wed Apr 4 15:02:51 2012 +0200 Fixed include guard copy/paste error diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.hxx b/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.hxx index de498a3..5159f94 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.hxx @@ -26,8 +26,8 @@ * / -#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_X86_64_CALLVIRTUALMETHOD_HXX -#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_X86_64_CALLVIRTUALMETHOD_HXX +#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_INTEL_CALLVIRTUALMETHOD_HXX +#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_INTEL_CALLVIRTUALMETHOD_HXX #include sal/config.h ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx |3 +++ bridges/source/cpp_uno/gcc3_linux_intel/except.cxx|5 - bridges/source/cpp_uno/gcc3_linux_intel/share.hxx |4 3 files changed, 11 insertions(+), 1 deletion(-) New commits: commit e2b7e28c12bb836fd7ab1dcbfc2460f807dd27f6 Author: LuboÅ¡ LuÅák l.lu...@suse.cz Date: Wed Apr 4 21:41:49 2012 +0200 adjust gcc3_linux_intel bridge to work with clang Otherwise exception throwing seems to be broken. This is a partial revert of b0515ea5fa6c29faebed616ae3e0213c72d24904. diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx index 4c6370f..34f261a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/callvirtualmethod.cxx @@ -36,6 +36,7 @@ #include typelib/typedescription.h #include callvirtualmethod.hxx +#include share.hxx // The call instruction within the asm block of callVirtualMethod may throw // exceptions. At least GCC 4.7.0 with -O0 would create (unnecessary) @@ -66,6 +67,8 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod( // unexpected size of int assert(nStackLongs pStackLongs); // no stack +if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything(xxx); // address something + volatile long edx = 0, eax = 0; // for register returns void * stackptr; asm volatile ( diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx index 6515b8f..e7e6e94 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx @@ -46,7 +46,6 @@ #include com/sun/star/uno/genfunc.hxx #include com/sun/star/uno/RuntimeException.hpp #include typelib/typedescription.hxx -#include uno/any2.h #include share.hxx @@ -60,6 +59,10 @@ using namespace ::__cxxabiv1; namespace CPPU_CURRENT_NAMESPACE { +void dummy_can_throw_anything( char const * ) +{ +} + //== static OUString toUNOname( char const * p ) SAL_THROW(()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx index 2eff557..dfa1bf9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx @@ -32,9 +32,13 @@ #include exception #include cstddef +#include uno/any2.h + namespace CPPU_CURRENT_NAMESPACE { +void dummy_can_throw_anything( char const * ); + // - following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h struct _Unwind_Exception ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx | 12 bridges/source/cpp_uno/mingw_intel/share.hxx | 12 2 files changed, 16 insertions(+), 8 deletions(-) New commits: commit a8e489495af7b0e74c3aca256e673fa6a34b9244 Author: Stephan Bergmann sberg...@redhat.com Date: Fri Mar 30 16:32:53 2012 +0200 Hack around different __cxa_* declarations in different GCC versions diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx index a02ccb2..f84958b 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx @@ -76,7 +76,14 @@ struct __cxa_eh_globals extern C CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () throw(); -// The following are in cxxabi.h since GCC 4.7: +namespace CPPU_CURRENT_NAMESPACE +{ + +// The following are in cxxabi.h since GCC 4.7 (they are wrapped in +// CPPU_CURRENT_NAMESPACE here as different GCC versions have slightly different +// declarations for them, e.g., with or without throw() specification, so would +// complain about redeclarations of these somewhat implicitly declared +// functions): #if __GNUC__ == 4 __GNUC_MINOR__ = 6 extern C void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); @@ -84,9 +91,6 @@ extern C void __cxa_throw ( void *thrown_exception, void *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); #endif -namespace CPPU_CURRENT_NAMESPACE -{ - // - //== diff --git a/bridges/source/cpp_uno/mingw_intel/share.hxx b/bridges/source/cpp_uno/mingw_intel/share.hxx index e813f49..46252e4 100644 --- a/bridges/source/cpp_uno/mingw_intel/share.hxx +++ b/bridges/source/cpp_uno/mingw_intel/share.hxx @@ -81,7 +81,14 @@ struct __cxa_eh_globals extern C CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () throw(); -// The following are in cxxabi.h since GCC 4.7: +namespace CPPU_CURRENT_NAMESPACE +{ + +// The following are in cxxabi.h since GCC 4.7 (they are wrapped in +// CPPU_CURRENT_NAMESPACE here as different GCC versions have slightly different +// declarations for them, e.g., with or without throw() specification, so would +// complain about redeclarations of these somewhat implicitly declared +// functions): #if __GNUC__ == 4 __GNUC_MINOR__ = 6 extern C void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); @@ -89,9 +96,6 @@ extern C void __cxa_throw ( void *thrown_exception, void *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); #endif -namespace CPPU_CURRENT_NAMESPACE -{ - // - //== ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/mingw_intel/except.cxx |9 - bridges/source/cpp_uno/mingw_intel/share.hxx | 19 ++- bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx |2 +- 3 files changed, 23 insertions(+), 7 deletions(-) New commits: commit 54e3855bffafe24d2dbb29451885282bab57ecef Author: Stephan Bergmann sberg...@redhat.com Date: Tue Mar 27 18:51:25 2012 +0200 MinGW: Adapted cpp_uno bridge to GCC 4.7 ...which incompatibly changed the calling convention of the third (dest) function pointer parameter of __cxa_throw to __thiscall. diff --git a/bridges/source/cpp_uno/mingw_intel/except.cxx b/bridges/source/cpp_uno/mingw_intel/except.cxx index 4b74588..308ccb8 100644 --- a/bridges/source/cpp_uno/mingw_intel/except.cxx +++ b/bridges/source/cpp_uno/mingw_intel/except.cxx @@ -29,7 +29,12 @@ #include stdio.h #include string.h + #include cxxabi.h +#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h +#define _GLIBCXX_CDTOR_CALLABI +#endif + #include boost/unordered_map.hpp #include rtl/instance.hxx @@ -193,7 +198,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR struct RTTISingleton: public rtl::Static RTTI, RTTISingleton {}; //-- -static void deleteException( void * pExc ) +extern C { +static void _GLIBCXX_CDTOR_CALLABI deleteException( void * pExc ) { __cxa_exception const * header = ((__cxa_exception const *)pExc - 1); typelib_TypeDescription * pTD = 0; @@ -206,6 +212,7 @@ static void deleteException( void * pExc ) ::typelib_typedescription_release( pTD ); } } +} //== void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) diff --git a/bridges/source/cpp_uno/mingw_intel/share.hxx b/bridges/source/cpp_uno/mingw_intel/share.hxx index da2367a..e6e4337 100644 --- a/bridges/source/cpp_uno/mingw_intel/share.hxx +++ b/bridges/source/cpp_uno/mingw_intel/share.hxx @@ -68,17 +68,26 @@ struct __cxa_exception _Unwind_Exception unwindHeader; }; +struct __cxa_eh_globals +{ +__cxa_exception *caughtExceptions; +unsigned int uncaughtExceptions; +}; + +} + +extern C CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () throw(); + +// The following are in cxxabi.h since GCC 4.7: +#if __GNUC__ == 4 __GNUC_MINOR__ = 6 extern C void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); extern C void __cxa_throw ( void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); +#endif -struct __cxa_eh_globals +namespace CPPU_CURRENT_NAMESPACE { -__cxa_exception *caughtExceptions; -unsigned int uncaughtExceptions; -}; -extern C __cxa_eh_globals *__cxa_get_globals () throw(); // - diff --git a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx index fd36c75..d2ae057 100644 --- a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx @@ -345,7 +345,7 @@ static void cpp_call( catch (...) { // fill uno exception -fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()-caughtExceptions, *ppUnoExc, pThis-getBridge()-getCpp2Uno() ); +fillUnoException( __cxa_get_globals()-caughtExceptions, *ppUnoExc, pThis-getBridge()-getCpp2Uno() ); // temporary params for ( ; nTempIndizes--; ) ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/mingw_intel/share.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9e46c8fcb85157b9f3e301e9a500c55f807526d4 Author: Stephan Bergmann sberg...@redhat.com Date: Tue Mar 27 22:26:05 2012 +0200 2nd param of __cxa_throw is void* in GCC = 4.6 diff --git a/bridges/source/cpp_uno/mingw_intel/share.hxx b/bridges/source/cpp_uno/mingw_intel/share.hxx index e6e4337..58fb72d 100644 --- a/bridges/source/cpp_uno/mingw_intel/share.hxx +++ b/bridges/source/cpp_uno/mingw_intel/share.hxx @@ -83,7 +83,7 @@ extern C CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () throw( extern C void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); extern C void __cxa_throw ( -void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); +void *thrown_exception, void *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); #endif namespace CPPU_CURRENT_NAMESPACE ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 37b6a37a2634cbb7bbe6602c3cc45b9ffccc05a7 Author: Tor Lillqvist t...@iki.fi Date: Wed Mar 7 01:53:43 2012 +0200 Fix compilation for simulator diff --git a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx index dc58f33..b5a5943 100644 --- a/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_ios_arm/uno2cpp.cxx @@ -112,8 +112,6 @@ namespace arm } } -#endif - void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pReturnType, sal_uInt32* pRegisterReturn) { switch( pReturnType-eTypeClass ) @@ -160,6 +158,8 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * } } +#endif + namespace { @@ -200,7 +200,7 @@ void callVirtualMethod( #else volatile long edx = 0, eax = 0; // for register returns -void * stackptr; +void * stackptr = 0; asm volatile ( mov %%esp, %6\n\t mov %0, %%eax\n\t ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |6 ++ bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) New commits: commit e13dc26e394ede799a60691638971cf1d9689f74 Author: Jani Monoses j...@ubuntu.com Date: Tue Feb 21 01:15:02 2012 +0200 ARM bridge: fixes for passing double arguments on the stack diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index 07bdea1..9750b6a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -70,6 +70,7 @@ namespace char * pCppStack = pTopStack; #ifdef __ARM_PCS_VFP +int dc = 0; char * pFloatArgs = (char *)(pCppStack - 64); #endif // return @@ -152,6 +153,11 @@ namespace 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; diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index 8e69ebe..98b29ba 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -362,7 +362,8 @@ void callVirtualMethod( { \ ++pDS; \ } \ -*pDS++ = *reinterpret_castdouble *( pSV );\ +*(double *)pDS = *reinterpret_castdouble *( pSV );\ +pDS += 2;\ } #else #define INSERT_FLOAT( pSV, nr, pFPR, pDS ) \ ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |4 1 file changed, 4 insertions(+) New commits: commit 3dfae9e2e6416ce2605b1db75e139f1185841a43 Author: Rene Engelhard r...@debian.org Date: Fri Feb 17 11:23:37 2012 +0100 fix armel/armv4t build diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index 97eff51..8e69ebe 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -279,7 +279,11 @@ void callVirtualMethod( #endif //Make the call ldr r5, %[pmethod]\n\t +#ifndef __ARM_ARCH_4T__ blx r5\n\t +#else +mov lr, pc ; bx r5\n\t +#endif //Fill in return values mov %[r0], r0\n\t ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S | 18 +++ bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx | 34 ++- bridges/source/cpp_uno/gcc3_linux_arm/share.hxx |2 bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx | 105 +++--- 4 files changed, 142 insertions(+), 17 deletions(-) New commits: commit dab11f7fe2a2fa4155e4c4feaa5fc54e57cfbd37 Author: Jani Monoses j...@ubuntu.com Date: Fri Feb 10 14:50:22 2012 +0200 ARM bridge: VFP ABI (armhf) support diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S index d5faf15..27148dc 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S +++ b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S @@ -10,6 +10,17 @@ # define UNWIND @ #endif +@ If the VFP ABI variant (armhf in Debian/Ubuntu) is used, an additional extra 64 bytes +@ are taken up on the stack (the equivalent of the 8 double precision VFP registers) + +#ifdef __ARM_PCS_VFP +# define PAD 80 +# define DISCARDED 84 +#else +# define PAD 16 +# define DISCARDED 20 +#endif + .file armhelper.s .text .align 4 @@ -19,9 +30,12 @@ privateSnippetExecutor: UNWIND .fnstart@ start of unwinder entry stmfd sp!, {r0-r3} @ follow other parameters on stack - UNWIND .pad #16 @ throw this data away on exception mov r0, ip @ r0 points to functionoffset/vtable mov r1, sp @ r1 points to this and params +#ifdef __ARM_PCS_VFP + vpush {d0-d7} @ floating point parameter on stack +#endif + UNWIND .pad #PAD @ throw this data away on exception @ (see cppuno.cxx:codeSnippet()) stmfd sp!, {r4,lr} @ save return address @ (r4 pushed to preserve stack alignment) @@ -30,7 +44,7 @@ privateSnippetExecutor: blcpp_vtable_call(PLT) add sp, sp, #4 @ no need to restore r4 (we didn't touch it) - ldr pc, [sp], #20@ return, discarding function arguments + ldr pc, [sp], #DISCARDED @ return, discarding function arguments UNWIND .fnend @ end of unwinder entry diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index d347aa0..07bdea1 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -69,6 +69,9 @@ namespace char * pTopStack = (char *)(pCallStack + 0); char * pCppStack = pTopStack; +#ifdef __ARM_PCS_VFP +char * pFloatArgs = (char *)(pCppStack - 64); +#endif // return typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) @@ -125,7 +128,9 @@ namespace { 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: @@ -133,13 +138,31 @@ namespace } #endif -pCppArgs[nPos] = pCppStack; -pUnoArgs[nPos] = pCppStack; +// For armhf we get the floating point arguments from a different area of the stack +// TODO: deal with functions with more than 8 floating point args that need to overflow +// to the stack. Find such an UNO API to try on. +#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); +} 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: @@ -179,6 +202,13 @@ namespace TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } } +#ifdef __ARM_PCS_VFP +// use the stack for output parameters or non floating point values +if (rParam.bOut || +
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) New commits: commit 4e679ee2501a0babcdce498732d68428d46481e3 Author: Jani Monoses j...@ubuntu.com Date: Fri Feb 3 22:11:08 2012 +0200 Simplify code and use proper register names for linux armhf diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index 9502b87..ac8ca23 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -152,11 +152,6 @@ namespace arm void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pReturnType, sal_uInt32* pRegisterReturn) { -#if !defined(__ARM_EABI__) !defined(__SOFTFP__) -register float fret asm(f0); -register double dret asm(f0); -#endif - switch( pReturnType-eTypeClass ) { case typelib_TypeClass_HYPER: @@ -176,6 +171,7 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * #if !defined(__ARM_PCS_VFP) (defined(__ARM_EABI__) || defined(__SOFTFP__)) pRegisterReturn[0] = r0; #else +register float fret asm(s0); *(float*)pRegisterReturn = fret; #endif break; @@ -184,6 +180,7 @@ void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pRegisterReturn[1] = r1; pRegisterReturn[0] = r0; #else +register double dret asm(d0); *(double*)pRegisterReturn = dret; #endif break; ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx | 49 -- 1 file changed, 20 insertions(+), 29 deletions(-) New commits: commit a55fa2d0a8f709bd58e2729b66fd8ecc807c0286 Author: Jani Monoses j...@ubuntu.com Date: Wed Feb 8 21:23:50 2012 +0200 Remove unnecessary variable diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index ac8ca23..fc8a9e2 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -258,16 +258,14 @@ void callVirtualMethod( } } -#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow ) \ +#define INSERT_INT32( pSV, nr, pGPR, pDS ) \ if ( nr arm::MAX_GPR_REGS ) \ pGPR[nr++] = *reinterpret_castsal_uInt32 *( pSV ); \ else \ -bOverFlow = true; \ -if (bOverFlow) \ *pDS++ = *reinterpret_castsal_uInt32 *( pSV ); #ifdef __ARM_EABI__ -#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart, bOverflow ) \ +#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) \ if ( (nr arm::MAX_GPR_REGS) (nr % 2) ) \ { \ ++nr; \ @@ -278,8 +276,6 @@ void callVirtualMethod( pGPR[nr++] = *(reinterpret_castsal_uInt32 *( pSV ) + 1); \ } \ else \ -bOverFlow = true; \ -if (bOverFlow) \ { \ if ( (pDS - pStart) % 2) \ { \ @@ -289,31 +285,27 @@ void callVirtualMethod( *pDS++ = reinterpret_castsal_uInt32 *( pSV )[1]; \ } #else -#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart, bOverflow ) \ -INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow) \ -INSERT_INT32( ((sal_uInt32*)pSV)+1, nr, pGPR, pDS, bOverflow) +#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) \ +INSERT_INT32( pSV, nr, pGPR, pDS ) \ +INSERT_INT32( ((sal_uInt32*)pSV)+1, nr, pGPR, pDS ) #endif -#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \ -INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow) +#define INSERT_FLOAT( pSV, nr, pFPR, pDS ) \ +INSERT_INT32( pSV, nr, pGPR, pDS ) -#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, pStart, bOverflow ) \ -INSERT_INT64( pSV, nr, pGPR, pDS, pStart, bOverflow ) +#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, pStart ) \ +INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) -#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverflow ) \ +#define INSERT_INT16( pSV, nr, pGPR, pDS ) \ if ( nr arm::MAX_GPR_REGS ) \ pGPR[nr++] = *reinterpret_castsal_uInt16 *( pSV ); \ else \ -bOverFlow = true; \ -if (bOverFlow) \ *pDS++ = *reinterpret_castsal_uInt16 *( pSV ); -#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverflow ) \ +#define INSERT_INT8( pSV, nr, pGPR, pDS ) \ if ( nr arm::MAX_GPR_REGS ) \ pGPR[nr++] = *reinterpret_castsal_uInt8 *( pSV ); \ else \ -bOverFlow = true; \ -if (bOverFlow) \ *pDS++ = *reinterpret_castsal_uInt8 *( pSV ); namespace { @@ -340,7 +332,6 @@ static void cpp_call( void * pCppReturn = 0; // if != 0 != pUnoReturn, needs reconversion -bool bOverFlow = false; bool bSimpleReturn = true; if (pReturnTypeDescr) { @@ -356,13 +347,13 @@ static void cpp_call( ? __builtin_alloca( pReturnTypeDescr-nSize ) : pUnoReturn); // direct way -INSERT_INT32( pCppReturn, nGPR, pGPR, pStack, bOverFlow ); +INSERT_INT32( pCppReturn, nGPR, pGPR, pStack ); } } // push this void * pAdjustedThisPtr = reinterpret_cast void ** (pThis-getCppI()) + aVtableSlot.offset; -INSERT_INT32( pAdjustedThisPtr, nGPR, pGPR, pStack, bOverFlow ); +INSERT_INT32( pAdjustedThisPtr, nGPR, pGPR, pStack ); // stack space OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), ### unexpected size! ); @@ -394,7 +385,7 @@ static void cpp_call( #if OSL_DEBUG_LEVEL 2 fprintf(stderr, hyper is %lx\n, pCppArgs[nPos]); #endif -INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, pStack, pStackStart, bOverFlow ); +INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, pStack, pStackStart ); break; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: @@ -402,22 +393,22 @@ static void cpp_call( #if OSL_DEBUG_LEVEL 2 fprintf(stderr, long is %x\n, pCppArgs[nPos]); #endif -INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); +INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack ); break; case typelib_TypeClass_SHORT: case typelib_TypeClass_CHAR: case typelib_TypeClass_UNSIGNED_SHORT: -INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow ); +
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx|2 -- bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx |2 -- bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx|2 -- 17 files changed, 34 deletions(-) New commits: commit 9377bb4dcc0d179293c044663c0bea5a113b64d9 Author: Julien Nabet serval2...@yahoo.fr Date: Sun Feb 5 10:19:40 2012 +0100 Some cppcheck cleaning diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx index 457b4f6..ca6b6a5 100644 --- a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx @@ -442,8 +442,6 @@ static typelib_TypeClass cpp_mediate( throw RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( no member description found! )), (XInterface *)pThis ); -// is here for dummy -eRet = typelib_TypeClass_VOID; } } diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx index bc049b5..eed34e3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx @@ -490,8 +490,6 @@ static typelib_TypeClass cpp_mediate( throw RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( no member description found! )), (XInterface *)pCppI ); -// is here for dummy -eRet = typelib_TypeClass_VOID; } } diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index 91b96cd..d347aa0 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -393,8 +393,6 @@ namespace throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( no member description found! )), (XInterface *)pCppI ); -// is here for dummy -eRet = typelib_TypeClass_VOID; } } diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index e962174..e2d9f83 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -533,8 +533,6 @@ namespace throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( no member description found! )), (XInterface *)pCppI ); -// is here for dummy -eRet = typelib_TypeClass_VOID; } } diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx index c496ab0..12ba0f6 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx @@ -473,8 +473,6 @@ static typelib_TypeClass cpp_mediate( throw RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( no member description found! )), (XInterface *)pThis ); -// is here for dummy -eRet = typelib_TypeClass_VOID; } } diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx index 7c46d1a..6cc5cce 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx @@ -401,8 +401,6 @@ namespace throw RuntimeException( OUString( RTL_CONSTASCII_USTRINGPARAM( no member description found! )), (XInterface *)pCppI ); -// is here for dummy -eRet = typelib_TypeClass_VOID; } } diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx index f1597c3..a275312 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx +++
[Libreoffice-commits] .: bridges/source configure.in set_soenv.in
bridges/source/cpp_uno/shared/makefile.mk |4 bridges/source/cpp_uno/shared/vtablefactory.cxx |8 configure.in|2 ++ set_soenv.in|1 + 4 files changed, 15 insertions(+) New commits: commit b8b22391ae7f87c8fb495a9e6839ed508fdaf932 Author: Robert Nagy robert.n...@gmail.com Date: Wed Dec 21 16:16:22 2011 +0100 only use posix_fallocate() if it's actually available diff --git a/bridges/source/cpp_uno/shared/makefile.mk b/bridges/source/cpp_uno/shared/makefile.mk index 4ce8122..c71ba6b 100644 --- a/bridges/source/cpp_uno/shared/makefile.mk +++ b/bridges/source/cpp_uno/shared/makefile.mk @@ -33,6 +33,10 @@ ENABLE_EXCEPTIONS = TRUE .INCLUDE: settings.mk +.IF $(HAVE_POSIX_FALLOCATE) == YES +CDEFS += -DHAVE_POSIX_FALLOCATE +.ENDIF + SLOFILES = \ $(SLO)$/bridge.obj \ $(SLO)$/component.obj \ diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index b049c7f..830d899 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -264,10 +264,18 @@ bool VtableFactory::createBlock(Block block, sal_Int32 slotCount) const } unlink(tmpfname); delete[] tmpfname; +#if defined(HAVE_POSIX_FALLOCATE) int err = posix_fallocate(block.fd, 0, block.size); +#else +int err = ftruncate(block.fd, block.size); +#endif if (err != 0) { +#if defined(HAVE_POSIX_FALLOCATE) SAL_WARN(bridges, posix_fallocate failed with code err); +#else +SAL_WARN(bridges, truncation of executable memory area failed with code err); +#endif close(block.fd); block.fd = -1; break; diff --git a/configure.in b/configure.in index 49c9758..897403a 100644 --- a/configure.in +++ b/configure.in @@ -3879,6 +3879,8 @@ fi if test $with_alloc = internal -o -z $with_alloc; then AC_MSG_RESULT([internal]) fi +AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO]) +AC_SUBST(HAVE_POSIX_FALLOCATE) AC_SUBST(ALLOC) dnl === diff --git a/set_soenv.in b/set_soenv.in index 06c8b30..b88c0cf 100755 --- a/set_soenv.in +++ b/set_soenv.in @@ -1934,6 +1934,7 @@ ToFile( HUNSPELL_LIBS, @HUNSPELL_LIBS@,e ); ToFile( SYSTEM_LPSOLVE,@SYSTEM_LPSOLVE@, e ); ToFile( HAVE_GETOPT, @HAVE_GETOPT@, e ); ToFile( HAVE_READDIR_R,@HAVE_READDIR_R@, e ); +ToFile( HAVE_POSIX_FALLOCATE,@HAVE_POSIX_FALLOCATE@, e ); ToFile( SYSTEM_LIBC, @SYSTEM_LIBC@, e ); ToFile( SYSTEM_HYPH, @SYSTEM_HYPH@, e ); ToFile( HYPHEN_LIB,@HYPHEN_LIB@, e ); ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: bridges/source
bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx |2 +- bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx |2 +- bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit e748b096633c5ef747f0630d13708d8dd7308a86 Author: Kristian Rietveld k...@lanedo.com Date: Sat Oct 15 01:15:21 2011 +0200 Mark ecx register as clobbered The inline assembly code executes a function call and functions are free to use eax, ecx and edx without preservation. We must thus mark ecx as a clobber register. diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx index 21febef..4443190 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx @@ -123,7 +123,7 @@ void callVirtualMethod( : : m(nStackLongs), m(pStackLongs), m(pAdjustedThisPtr), m(nVtableIndex), m(eax), m(edx), m(stackptr) -: eax, edx ); +: eax, ecx, edx ); switch( pReturnTypeDescr-eTypeClass ) { case typelib_TypeClass_VOID: diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx index 9f5..89f5381 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx @@ -119,7 +119,7 @@ void callVirtualMethod( : : m(nStackLongs), m(pStackLongs), m(pAdjustedThisPtr), m(nVtableIndex), m(eax), m(edx), m(stackptr) -: eax, edx ); +: eax, ecx, edx ); switch( pReturnTypeDescr-eTypeClass ) { case typelib_TypeClass_VOID: diff --git a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx index 4dd6cde..45d20b3 100644 --- a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx @@ -112,7 +112,7 @@ void callVirtualMethod( : : m(nStackLongs), m(pStackLongs), m(pAdjustedThisPtr), m(nVtableIndex), m(eax), m(edx), m(stackptr) -: eax, edx ); +: eax, ecx, edx ); switch( returnType-eTypeClass ) { case typelib_TypeClass_VOID: ___ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits