Re:Show HN: Compile for Arm at native speeds in an emulated ...
by gizdan on Wednesday September 01, 2021 @04:42AM
(#28377587)
Any chance you can add a high level explanation on how this works?
[ Parent
| on HN ]
Re:Show HN: Compile for Arm at native speeds in an emulated ...
by rfoo on Wednesday September 01, 2021 @04:55AM
(#28377637)
Prepare a rootfs for ARM64 system. chroot into it and emulate every binary with qemu-user. Now replace gcc etc with one configured as cross-compiler, but still point its sysroot to the usual path (/usr/...).
This is equivalent to building a x86-to-aarch64 cross-compiler and point the sysroot to a ARM64 rootfs, but more intuitive to users unfamiliar with cross toolchains, and more friendly to those mad configure scripts which insist on assuming host = target and detect everything automatically.
Re:Show HN: Compile for Arm at native speeds in an emulated ...
by bsdimp on Wednesday September 01, 2021 @12:07PM
(#28381641)
You forgot the following steps:
Profile to see what's the slowest thing
Make a native version of that.
In FreeBSD package builder setup, we also have /bin/sh and a few other heavily used binaries that are native because it shaves hours or days off a package run (itself takes 10 days, even optimized like this).