Closed guysoft closed 4 years ago
But this is compiling on a Raspberry Pi, right ? Hmm... it would be so nice to be able to cross compile :)
Its compiling using qemu, as stated in the CustomPiOS README. You dont need a raspberrypi. Its still slow because its compiling using emulation, but you can use a stronger virtual machine.
I see. But is there a reason why the cross-compilation tools aren't used instead ?
Yes, because cross-compiling means you have to have a separate toolchain. Lets say you want to build this on windows, mac, linux32 bit. linux with different versions of GCC, you will have to support all of that. This way the toolchain is what is on the Raspberrypi. CustomPiOS does much more than just compiling, it ships a distribution.
The cost of a single compile toolchain is that the compilation can take a long time. The gain is:
You could technically build a separate system to compile kernels and maintain it against RealtimePi, and have RealtimePi use the kernels from there. But good luck with that. I have no time for it or support all system configurations.
What I can suggest is have a local environment to compile and test kernels, and use RealtimePi when you want a deterministic compilation environment that you can ship those kernels.
I hope its a good answer to "why?".
It indeed is. Thanks.
Ah, damn. For others to know: It is not possible to build on WSL (Win 10), because of the lack of the "loop" module (and probably other issues as well), so I'll be resorting to a VM to do this.
@robiwano See https://github.com/guysoft/CustomPiOS/issues/22 , I am really close to getting the build running on windows. I in fact got it to build, just need to formalize it.
Docker build should now let you build on windows. It should also help compile time because its one virtualization less. Still cross-compile via qemu is slower than native tools. But I am not sure if there is a way around it other than supplying a completely separate toolchain.
Ok, this seems to be solved, or have a workaround. The docker image now supported building on arm32v7. Which is how the nightly builds are built. The compile time went down from ~16 hours to only 2! So I am closing this unless someone wants to talk about amd64 o different arches specifically.
Compile time can easily reach up to 12 hours. The way to do this would be to build the kernel in the vm, and only then chroot with qemu. But CustomPiOSs architecture would not allow that.