View previous topic :: View next topic |
Author |
Message |
Aed n00b
Joined: 09 Apr 2008 Posts: 2
|
Posted: Wed Apr 09, 2008 7:28 pm Post subject: Enabling soft-fp on x86 (Not cross compiler) |
|
|
Hi,
I'm trying to use the gcc flag "-msoft-float" in order to instrument and profile use of FP code in my project. The compiler generates the appropriate stubs, however glibc doesn't compile the "soft-fp" module by default on x86. How can I force this?
Thanks,
Aed |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54390 Location: 56N 3W
|
Posted: Wed Apr 09, 2008 8:14 pm Post subject: |
|
|
Aed,
Welcome to gentoo
gcc never provides the software floating point emulation when you use "-msoft-float". On arm at least, you have to make your own arrangements.
On x86, the floating point emulation is provided in the kernel. It traps x86 FPU instructions and emulates them. However, building the kernel with software floating point enable is not enough as the kernel will use the real FPU if its fitted. You need to provide the kernel option that tells the kernel your FPU is faulty and not to use it.
Doing software floating point this way means that binaries compiled to expect a real FPU just work, only much slower. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Aed n00b
Joined: 09 Apr 2008 Posts: 2
|
Posted: Wed Apr 09, 2008 8:35 pm Post subject: |
|
|
NeddySeagoon wrote: | Aed,
Welcome to gentoo
gcc never provides the software floating point emulation when you use "-msoft-float". On arm at least, you have to make your own arrangements.
On x86, the floating point emulation is provided in the kernel. It traps x86 FPU instructions and emulates them. However, building the kernel with software floating point enable is not enough as the kernel will use the real FPU if its fitted. You need to provide the kernel option that tells the kernel your FPU is faulty and not to use it.
Doing software floating point this way means that binaries compiled to expect a real FPU just work, only much slower. |
Hi,
On ARM, the module soft-fp would be compiled in glibc and provide the stubbed out functions implied with gcc's "-msoft-float". I want to enable this build path on x86.
Making alterations to the kernel is not an option for me, unfortunately.
Thanks for the reply. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|