4 ms·
Is cross compilation out of the question?
by leni536 7mo ago
Is cross compilation out of the question?
- IshKebab 7mo agoIt's usually an enormous pain to set up. QEMU is probably the best option.
- sofixa 7mo agoDepends on the language, it's pretty trivial with Go.
- STKFLT 7mo agoMaybe there are issues I'm not aware of but using dockcross has made cross-compilation quite easy in my experience. https://github.com/dockcross/dockcross https://github.com/dockcross/dockcross
- mort96 7mo agoHow does it handle .so version differences and glibc version differences between the container and the target system?
- pantalaimon 7mo agoT2 manages to do it https://t2linux.com/ https://t2linux.com/
- VorpalWay 7mo agoYocto, which we use at work, manages it just fine to build a whole embedded Linux distro. So I don't see why Fedora couldn't make it work if they wanted. You could even scp over the test suites to run that on native systems if you wanted.
- mort96 7mo agoYocto manages it thanks to the tireless effort of a community of people maintaining patches and unholy hacks for a ton of software to make it cross compilable. And they have nowhere near the amount of recipes that Fedora has.
- VorpalWay 7mo agoThis is true, but the hacks are mostly in the C and C++ recipes as I understand it. Something like Rust or especially Go or Zig is far easier to cross compile. I personally found cross compiling Rust easy, as long as you don't have C dependencies. If you have C dependencies it becomes way harder. This suggests that spending time to upstream cross compilation fixes would be worth it for everyone, and probably even in the C world, 20% of the packages need 80% of the effort.
- mort96 7mo agoI wonder if Fedora packages any C and C++ software?
- NetMageSCW 7mo agoI wonder how much of Fedora is written in Rust?
- STKFLT 7mo agoI'd guess that the issue is running the `%install` and `%check` stages of the .spec file. The Python library rpy (to pull a random example from Marcin's PRs) runs rpy's pytest test suite and had to be modified to avoid running vector tests on RISC-V. Obviously a solvable problem to split build and test but perhaps the time savings aren't worth the complexity. https://src.fedoraproject.org/rpms/rpy/pull-request/4#request_diff https://src.fedoraproject.org/rpms/rpy/pull-request/4#reques...
- leni536 7mo agoMaybe the tests could be run with user-mode qemu instead of the whole thing running under qemu or on RISC-V hardware. Could possibly be more or less seamless with binfmt_misc being set up in the builders.
- kashyapc 7mo agoNear as I know, Fedora prefers native compilation for the builds. Your question made me look up Arm's history in Fedora and came up on this 2012 LWN thread[1]. There's some discussion against cross-compilation already back then. [1] https://lwn.net/Articles/487622/ https://lwn.net/Articles/487622/