Bug 41443 - libffi fails to build with -mfloat-abi=softfp
Summary: libffi fails to build with -mfloat-abi=softfp
Status: RESOLVED DUPLICATE of bug 40242
Alias: None
Product: gcc
Classification: Unclassified
Component: libffi (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-23 08:43 UTC by Matthias Klose
Modified: 2009-09-23 14:10 UTC (History)
7 users (show)

See Also:
Host:
Target: arm-linux-gnueabi
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-09-23 12:39:24


Attachments
patch (357 bytes, patch)
2009-09-23 13:19 UTC, Matthias Klose
Details | Diff
fixed patch (551 bytes, patch)
2009-09-23 14:03 UTC, Matthias Klose
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2009-09-23 08:43:34 UTC
seen on the trunk:

/home/doko/gcc/snap/x/gcc-snapshot-20090919/build/./gcc/xgcc -B/home/doko/gcc/snap/x/gcc-snapshot-20090919/build/./gcc/ -B/usr/lib/gcc-snapshot/arm-linux-gnueabi/bin/ -B/usr/lib/gcc-snapshot/arm-linux-gnueabi/lib/ -isystem /usr/lib/gcc-snapshot/arm-linux-gnueabi/include -isystem /usr/lib/gcc-snapshot/arm-linux-gnueabi/sys-include -DHAVE_CONFIG_H -I. -I../../../src/libffi -I. -I../../../src/libffi/include -Iinclude -I../../../src/libffi/src -I. -I../../../src/libffi/include -Iinclude -I../../../src/libffi/src -g -O2 -c ../../../src/libffi/src/arm/sysv.S -mfloat-abi=softfp -fPIC -DPIC -o src/arm/.libs/sysv.o
../../../src/libffi/src/arm/sysv.S: Assembler messages:
../../../src/libffi/src/arm/sysv.S:203: Error: selected processor does not support `stfeqs f0,[r2]'
../../../src/libffi/src/arm/sysv.S:208: Error: selected processor does not support `stfeqd f0,[r2]'
../../../src/libffi/src/arm/sysv.S:283: Error: selected processor does not support `ldfs f0,[sp]'
../../../src/libffi/src/arm/sysv.S:286: Error: selected processor does not support `ldfd f0,[sp]'
../../../src/libffi/src/arm/sysv.S:289: Error: selected processor does not support `ldfd f0,[sp]'
Comment 1 Matthias Klose 2009-09-23 08:49:41 UTC
using binutils 2.19.91.20090910
Comment 2 Matthias Klose 2009-09-23 09:24:24 UTC
gcc configured with: --with-arch=armv6 --with-tune=cortex-a8 --with-float=softfp --with-fpu=vfp
Comment 3 jsm-csl@polyomino.org.uk 2009-09-23 11:11:09 UTC
Subject: Re:   New: libffi fails to build with -mfloat-abi=softfp

On Wed, 23 Sep 2009, doko at ubuntu dot com wrote:

> ../../../src/libffi/src/arm/sysv.S: Assembler messages:
> ../../../src/libffi/src/arm/sysv.S:203: Error: selected processor does not
> support `stfeqs f0,[r2]'

All the references to __SOFTFP__ in this file 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.

If you change 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, and new libffi code to 
handle that ABI.

Comment 4 jsm-csl@polyomino.org.uk 2009-09-23 11:28:07 UTC
Subject: Re:  libffi fails to build with -mfloat-abi=softfp

The __ARM_ARCH__ settings in this file are also out of date (no handling 
of __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__, __ARM_ARCH_7A__, 
__ARM_ARCH_7R__, __ARM_ARCH_7M__).  So you're going to get suboptimal code 
when building for newer architectures.

Comment 5 Ramana Radhakrishnan 2009-09-23 12:41:35 UTC
A dup of PR40242.

*** This bug has been marked as a duplicate of 40242 ***
Comment 6 Matthias Klose 2009-09-23 13:19:16 UTC
Created attachment 18636 [details]
patch

testing the attached patch
Comment 7 Matthias Klose 2009-09-23 14:03:27 UTC
Created attachment 18637 [details]
fixed patch

fixed patch, no regressions when applied to libffi-3.0.7
Comment 8 Andrew Haley 2009-09-23 14:10:59 UTC
This patch is fine.  Post it to the gcc list and I'll approve it.
Comment 9 Matthias Klose 2009-09-23 14:50:59 UTC
Subject: Bug 41443

Author: doko
Date: Wed Sep 23 14:50:35 2009
New Revision: 152075

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152075
Log:
2009-09-23  Matthias Klose  <doko@ubuntu.com>

        PR libffi/40242, PR libffi/41443
        * src/arm/sysv.S (__ARM_ARCH__): Define for processors
        __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
        __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
        Change the conditionals to __SOFTFP__ || __ARM_EABI__
        for -mfloat-abi=softfp to work.

Modified:
    trunk/libffi/ChangeLog
    trunk/libffi/src/arm/sysv.S

Comment 10 Matthias Klose 2009-09-23 15:08:29 UTC
Subject: Bug 41443

Author: doko
Date: Wed Sep 23 15:08:02 2009
New Revision: 152078

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152078
Log:
2009-09-23  Matthias Klose  <doko@ubuntu.com>

        PR libffi/40242, PR libffi/41443
        * src/arm/sysv.S (__ARM_ARCH__): Define for processors
        __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
        __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
        Change the conditionals to __SOFTFP__ || __ARM_EABI__
        for -mfloat-abi=softfp to work.

Modified:
    branches/gcc-4_4-branch/libffi/ChangeLog
    branches/gcc-4_4-branch/libffi/src/arm/sysv.S

Comment 11 Matthias Klose 2009-09-23 15:11:42 UTC
Subject: Bug 41443

Author: doko
Date: Wed Sep 23 15:11:17 2009
New Revision: 152079

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152079
Log:
2009-09-23  Matthias Klose  <doko@ubuntu.com>

        PR libffi/40242, PR libffi/41443
        * src/arm/sysv.S (__ARM_ARCH__): Define for processors
        __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
        __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
        Change the conditionals to __SOFTFP__ || __ARM_EABI__
        for -mfloat-abi=softfp to work.

Modified:
    branches/gcc-4_3-branch/libffi/ChangeLog
    branches/gcc-4_3-branch/libffi/src/arm/sysv.S