Re:FreeBSD Can Now Be Built From Linux/macOS Hosts, Transiti...
by bch on Thursday October 22, 2020 @02:12PM
(#24861247)
> I imagine it's mostly build system scripting.
NetBSD has had this[0] for ~20 years (requiring only POSIX conformance from the build host). Think of it as a sort of first principle[1] in action. I wouldn’t be surprised if FreeBSD could achieve some success leaning on this work.
FreeBSD builds using makefiles, and the BSD make is not the same as GNU make, especially for the sometimes-complicated scripting they have to do inside of them.
Adding cross-compilation to a complicated set of makefiles isn't impossible but can be some work.
Beyond that there are other issues... eg. The ELF binaries generated need to declare themselves as FreeBSD binaries. A C compiler set up to produce Linux binaries won't do that. Maybe also they depend on a specific compiler (FreeBSD is using clang lately). When you build FreeBSD you also build a compiler so maybe this part isn't such a big deal.