From c4989e147f02f0c39e3cdaa9be4223d4fa4b438a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 6 Oct 2009 15:00:30 +0000 Subject: #i105302# allow build with -mfloat-abi=softfp -mfpu=vfp --- bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index b365bdb8aee1..f59a16b2ac38 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -45,7 +45,17 @@ #include #include -#if defined(__ARM_EABI__) && !defined(__SOFTFP__) +/* + * Based on http://gcc.gnu.org/PR41443 + * References to __SOFTFP__ are incorrect for EABI; the __SOFTFP__ code + * should be used for *soft-float ABI* whether or not VFP is enabled, + * and __SOFTFP__ does specifically mean soft-float not soft-float ABI. + * + * Changing the conditionals to __SOFTFP__ || __ARM_EABI__ then + * -mfloat-abi=softfp should work. -mfloat-abi=hard won't; that would + * need both a new macro to identify the hard-VFP ABI. + */ +#if !defined(__ARM_EABI__) && !defined(__SOFTFP__) #error Not Implemented /* @@ -103,7 +113,7 @@ namespace arm void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn) { -#ifndef __SOFTFP__ +#if !defined(__ARM_EABI__) && !defined(__SOFTFP__) register float fret asm("f0"); register double dret asm("f0"); #endif @@ -128,14 +138,14 @@ void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterR *(unsigned char*)pRegisterReturn = (unsigned char)r0; break; case typelib_TypeClass_FLOAT: -#ifdef __SOFTFP__ +#if defined(__ARM_EABI__) || defined(__SOFTFP__) ((long*)pRegisterReturn)[0] = r0; #else *(float*)pRegisterReturn = fret; #endif break; case typelib_TypeClass_DOUBLE: -#ifdef __SOFTFP__ +#if defined(__ARM_EABI__) || defined(__SOFTFP__) ((long*)pRegisterReturn)[1] = r1; ((long*)pRegisterReturn)[0] = r0; #else -- cgit