On Tue, Oct 25, 2022, at 00:03, Punit Agrawal wrote: > Diederik de Haas <didi.deb...@cknow.org> writes: > >> But it can be that I'm looking at this problem all wrong and/or have some >> tunnel vision towards building a cross compiler. >> That is an important reason for making this ML thread. > > IIUC, for the kernel, either compiler should be fine. The > documentation[0] for compiling the RPi Zero kernel seems to bear this > out - it even uses the "CROSS_COMPILE=arm-linux-gnueabihf-". If you've > got access to the hardware it should be easy to test before kicking off > the Debian kernel package build.
That is correct: it's the same compiler backend, the only difference between an arm-linux-gnuabihf- and an arm-linux-gnueabi- toolchain are which CPU and floating pointing ABI are set when building with the default flags. The kernel itself is always built as soft-float even for armv7 using an armhf toolchain, and the CPU is always set to the minimum configured target machine, so both compilers will produce the same kernel binary. Note that at the moment, you can build a kernel that works on both armv6 and armv7 CPUs, or armv7 and armv8, but not armv5 and armv6/v7, or armv6 and armv8, and this limits what machines can be enabled in a single kernel. I have a prototype kernel patch that intends to change the way we build armv6 kernels, so one can actually enable armv6 non-SMP support (Raspberry Pi 0/1, OMAP2, i.MX3, s3c64xx, ...) in the default armel kernel along with the ARMv5 targets (orion, kirkwood, pxa, at91, omap1, imx2, suniv, ...), but no longer with ARMv7. Arnd