[HN Gopher] Show HN: Compile for Arm at native speeds in an emul...
___________________________________________________________________
Show HN: Compile for Arm at native speeds in an emulated system
Author : valkmit
Score : 37 points
Date : 2021-09-01 04:29 UTC (5 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| pm215 wrote:
| This is the same trick used by the old 'scratchbox' development
| environment that Nokia used for the maemo SDK. If the stuff you
| compile in it includes classic "configure and make" C/C++
| projects then you'll probably also find that replacing the
| /bin/sh binary with an x86 one improves speeds -- configure and
| make spend quite a lot of time spawning shells to run bits of
| shell script.
| Ecco wrote:
| This should be at the top: https://github.com/valkmit/aws-
| graviton2-on-intel#justificat...
| valkmit wrote:
| Thanks, I'll add it now
| parsecs wrote:
| I think they are suggesting to move the justification section
| of the github page to the top of the github readme. (Instead
| of posting another comment on HN)
| valkmit wrote:
| Justification:
|
| https://github.com/valkmit/aws-graviton2-on-intel#justificat...
| pabs3 wrote:
| I like how cross-compiling works on Debian, you install the
| native cross-compiler on your amd64 system, auto-install the
| cross-dependencies built natively on arm64 systems onto your
| amd64 system and then build. Of course, not all dependencies are
| cross-installable and not all packages are cross-buildable, which
| is why there is a QA effort for automatically doing test builds.
|
| https://wiki.debian.org/CrossCompiling http://crossqa.debian.net/
| gizdan wrote:
| Any chance you can add a high level explanation on how this
| works?
| rfoo wrote:
| 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.
___________________________________________________________________
(page generated 2021-09-01 10:00 UTC)