This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libffi/40242] New: unsupported asm instructions in libffi/src/arm/sysv.S
- From: "mkl at pengutronix dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 May 2009 13:51:35 -0000
- Subject: [Bug libffi/40242] New: unsupported asm instructions in libffi/src/arm/sysv.S
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hello,
during cross compilation of gcc, the libffi build for the target breaks with
this error message:
libtool: compile: /home/frogger/pengutronix/toolchain/libffi/build/./gcc/xgcc
-B/home/frogger/pengutronix/toolchain/libffi/build/./gcc/
-B/usr/local/arm-1136jfs-linux-gnueabi/bin/
-B/usr/local/arm-1136jfs-linux-gnueabi/lib/ -isystem
/usr/local/arm-1136jfs-linux-gnueabi/include -isystem
/usr/local/arm-1136jfs-linux-gnueabi/sys-include -I.
-I../../../gcc-4.4.0/libffi/include -Iinclude -I../../../gcc-4.4.0/libffi/src
-g -O2 -c ../../../gcc-4.4.0/libffi/src/arm/sysv.S -fPIC -DPIC -o
src/arm/.libs/sysv.o
../../../gcc-4.4.0/libffi/src/arm/sysv.S: Assembler messages:
../../../gcc-4.4.0/libffi/src/arm/sysv.S:202: Error: selected processor does
not support `stfeqs f0,[r2]'
../../../gcc-4.4.0/libffi/src/arm/sysv.S:207: Error: selected processor does
not support `stfeqd f0,[r2]'
../../../gcc-4.4.0/libffi/src/arm/sysv.S:282: Error: selected processor does
not support `ldfs f0,[sp]'
../../../gcc-4.4.0/libffi/src/arm/sysv.S:285: Error: selected processor does
not support `ldfd f0,[sp]'
../../../gcc-4.4.0/libffi/src/arm/sysv.S:288: Error: selected processor does
not support `ldfd f0,[sp]'
the offending code is:
#ifndef __SOFTFP__
beq LSYM(Lepilogue)
@ return FLOAT
cmp r3, #FFI_TYPE_FLOAT
stfeqs f0, [r2]
beq LSYM(Lepilogue)
@ return DOUBLE or LONGDOUBLE
cmp r3, #FFI_TYPE_DOUBLE
stfeqd f0, [r2]
#endif
gcc is configured this way:
../gcc-4.4.0/configure --enable-languages=c,c++,java
--target=arm-1136jfs-linux-gnueabi
--with-mpfr=/home/frogger/pengutronix/toolchain/OSELAS.Toolchain-trunk/platform-arm-v4t-linux-gnueabi-gcc-4.4.0-glibc-2.9-binutils-2.19.1-kernel-2.6.29-sanitized/sysroot-host
--with-gmp=/home/frogger/pengutronix/toolchain/OSELAS.Toolchain-trunk/platform-arm-v4t-linux-gnueabi-gcc-4.4.0-glibc-2.9-binutils-2.19.1-kernel-2.6.29-sanitized/sysroot-host
--with-float=softfp --with-fpu=vfp --with-cpu=arm1136jf-s
--with-sysroot=/opt/OSELAS.Toolchain-1.99.3/arm-1136jfs-linux-gnueabi/gcc-4.3.2-glibc-2.8-binutils-2.19-kernel-2.6.27-sanitized/sysroot-arm-1136jfs-linux-gnueabi
I.e. as an arm-eabi target, --with-fpu=vfp and --with-float=softfp. Which means
floats are passed in integer registers, but in function the compiler generates
floating point instructions, the preprocessor doesn't define a "__SOFTFP__"
symbol.
If configuring the compiler with "--with-float=soft" it will pass floats in
integer registers and it will generate softfloat emulation code. In this case
the preprocessor defines "__SOFTFP__".
In both variants the function calling convention is the same, but in one case
we have the __SOFTFP__ symbol in the other not.
libffi changes it's behaviour depending on this symbol, which is IMHO not
correct.
I've tested some combinations, this is the summary of
(echo | arm-v4t-linux-gnueabi-cpp -dM -mfloat-abi=XXX -mfpu=YYY| egrep -i
'vfp|fp|soft|hard|float'):
-mfloat-abi=soft -mfpu=vfp __SOFTFP__ __VFP_FP__
-mfloat-abi=softfp -mfpu=vfp __VFP_FP__
-mfloat-abi=hard -mfpu=vfp __VFP_FP__ (sorry, unimplemented)
-mfloat-abi=soft -mfpu=fpa __SOFTFP__
-mfloat-abi=softfp -mfpu=fpa
-mfloat-abi=hard -mfpu=fpa
I'm not sure which of these combinations makes sense, or are actually used, the
3rd one seems not to be implemented, though. We at pengutronix use usually 1.
and 2. In some weird projects 4. and 6. but not with the current gcc.
This table shows that it's not possible to distinguish between the "hard" and
"softfp" case, a diff off the preprocessor's output shows no difference in the
symbols tough. On the upside the vfp-hard case seems not to be implemented.
So the question is which is the correct symbol for libffi?
cheers, Marc
--
Summary: unsupported asm instructions in libffi/src/arm/sysv.S
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libffi
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mkl at pengutronix dot de
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: arm-1136jfs-linux-gnueabi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40242