In the past I have compiled binaries for different architectures on an x86_x64 with the resulting target binary generated for a different architecture;
For instance the target binary might be for something like an IA64 or an ARM processor using make
and gcc
to compile C++ code and copying the resulting binary to a machine of that architecture type would (most of the time; assuming dependencies fulfilled) allow it run.
This is for different reasons, for instance on an I64 architecture, I didn't want to install all the dependencies for compilation on a server. And in the case of ARM (that it being for a Raspberry Pi) that it would take such a long time to compile.
Now that said, I haven't tired cross-compiling Haskell for ARM though the Haskell wiki appears to mention a docker image for doing so, and also a guide here. The guide seems a little out of date however, since I can't seem to download build-dep
that it requires.
(I'm running Ubuntu 18.04 LTS)
Also, what dpkg --add-architecture <armxx>
command should I run to add multiple architectures?