This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
ARM: How does __attribute__((pcs(âaapcsâ))) should be used in HardFP ABI programs?
- From: Juan GÃmez <atilag at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 8 Apr 2015 23:12:07 +0200
- Subject: ARM: How does __attribute__((pcs(âaapcsâ))) should be used in HardFP ABI programs?
- Authentication-results: sourceware.org; auth=none
Hi! I ended up here because of the subject message, but it started
some time ago here:
http://stackoverflow.com/questions/28932005/how-does-attribute-pcsaapcs-should-be-used-in-hardfp-abi-programs
. I'd like to run hardfp with softfp programs/libraries by makeing
some kind of wrapper/adapter. So one approach to do it could be
exploiting aapcs / aapcs-vfp attributes, but I'm not really sure if
this attributes work like I think they would. All the details are in
the stackoverflow question, but I'll paste them here as well:
I have a HardFP ABI (very) simple test program. It links with other
HardFP binaries without any problems. Now I wanted to use a function
from a Softfp ABI library in my code, so I changed the header file
(.h) from this library to add the attibute: __
attribute__((pcs("aapcs"))) on every function which uses double args
(like: void doSomething(double arg, double arg2)), so I'm telling the
toolchain that this library uses softfp ABI. The problem is that the
toolchain (arm-linux-androideabi-4.9) is yelling me that:
/media/data_disk/b2g/work/hardfp/arm-linux-androideabi-4.9/bin/../lib/gcc/arm-linux-androideabi/4.9.x-google/../../../../arm-linux-androideabi/bin/ld:
error: /tmp/cc6SmP3D.o uses VFP register arguments, output does not
/media/data_disk/b2g/work/hardfp/arm-linux-androideabi-4.9/bin/../lib/gcc/arm-linux-androideabi/4.9.x-google/../../../../arm-linux-androideabi/bin/ld:
error: /home/jgomez/b2g/build.flatfish.hardfp/out/target/product/flatfish/obj/lib/libc.so
uses VFP register arguments, output does not
/media/data_disk/b2g/work/hardfp/arm-linux-androideabi-4.9/bin/../lib/gcc/arm-linux-androideabi/4.9.x-google/../../../../arm-linux-androideabi/bin/ld:
error: /home/jgomez/b2g/build.flatfish.hardfp/out/target/product/flatfish/obj/lib/libstdc++.so
uses VFP register arguments, output does not
/media/data_disk/b2g/work/hardfp/arm-linux-androideabi-4.9/bin/../lib/gcc/arm-linux-androideabi/4.9.x-google/../../../../arm-linux-androideabi/bin/ld:
error: /home/jgomez/b2g/build.flatfish.hardfp/out/target/product/flatfish/obj/lib/libm.so
uses VFP register arguments, output does not
(Of course, libc, libstdc++, and libm are hardfp too).
It doesn't compile.
So my question is, How does __attribute__((pcs("aapcs"))) should be
used to let HardFP ABI programs link with Softfp ABI binaries?
I thought that this was the purpose of such a flag. Am I wrong?
Thanks!!