1

I am using a redhawk 6.5.8 system with GNU GCC 4.9.2. I downloaded the source and compiled GCC for the platform as a native compiler.

I now need to start compiling application, but as you know, the floating point used for my applications have to me compatible with the libc version I am using.

How can I know whether the libc in my system (libc.so.6) was built using soft-float and hard-float?

I have tried many commands, such as ldd, objdump, readelf and still is not clear.

Thanks a lot

temax
  • 11
  • 2
  • Shouldn't linker warn you when you use incompatible floats? See this question: http://stackoverflow.com/questions/3321468/whats-the-difference-between-hard-and-soft-floating-point-numbers – Oleg Andriyanov Dec 17 '16 at 00:05
  • Yes, but that doesn't really answer my question, unfortunately. Independently of that, I would like to know a way to find out how libc was compiled, if soft-float or hard-float. Thanks! – temax Dec 17 '16 at 07:47
  • gcc -v will show the fpu options used. Default libc usually is compiled using the same fpu options. – sunil Jul 17 '18 at 06:04

1 Answers1

2

If you have a readelf binary available to you, you can follow the directions here[1] like so:

readelf -a /lib/libm.so.6 | grep FP

The link flag Tag_ABI_HardFP_use will be a good clue to look for, but there may be other flags that I'm not aware of. That one works for me.

[1] https://www.cnx-software.com/2013/04/22/how-to-detect-if-an-arm-elf-binary-is-hard-float-armhf-or-soft-float-armel/

Jonah
  • 146
  • 2
  • 4