Noticed something odd last night, when compiling a plain vanilla linux kernel for my panda board. My default gcc is hard float, but passing V=1 to the make command could see -msoft-float was being defined. Turns out its defined that way in arch/arm/Makefile.
So just wondering if the same issue is there for rasbrian kernels - e.g. has it inadvertently been compiled soft float due to the default make file?
Not sure it makes any difference though - are there any floats used in the kernel?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Hard Float kernel for Rasbrian
No.summers wrote:Not sure it makes any difference though - are there any floats used in the kernel?
Re: Hard Float kernel for Rasbrian
That's not entirely true. Floats can be used inside of kernel but their usage is discouraged (as there is no good way to do it cross platform) . Also it is used in a very specific way which is independent from the float ABI so it doesn't matter if you are using hardfp or softfp compiler. softfp compiler parameters are forced to be sure no one is using floating point in the way it's used in userspace. Here's quite good explanation of this.
Re: Hard Float kernel for Rasbrian
Interesting article. Yes I can see why the set -msoft-float now. Logic a bit convoluted. Guess its just strongly encouraging people not to use floats in the kernel, which I guess could be more transparanetly done by one of the coding rules for the kernel.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6505
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Hard Float kernel for Rasbrian
Whilst it is possible to use floating point from the kernel, there's no reference to kernel_fpu_begin from the RPi kernel, so I don't believe we do.
Re: Hard Float kernel for Rasbrian
Yes, greping kernel sources one can find that floats are only used in x86 specific code and raid6 implementation.