On Fri, Jul 29, 2016 at 7:04 PM, Jeffrey Walton <noloa...@gmail.com> wrote:
> How does one build an Aarch32 program on Aarch64?

The arm and aarch64 compilers are separate compiler ports.  So you
need two different compilers, an arm compiler and an aarch64 compiler.
The arm compiler emits only 32-bit code.  The aarch64 compiler emits
only 64-bit code.  The native compiler is an aarch64 compiler.  I
don't think that we ship arm cross compilers for that.  You could try
to build one but this isn't the solution I would recommend.  If you
have ubuntu, then there is a gcc-arm-linux-gnueabihf package you can
install.  Note that aarch64 systems don't have mutlilib/multiarch
support yet like i686/x86_64 systems.  At least not Ubuntu 14.04LTS
trusty and Debian Jessie.  If you static link, you might get arm code
working in an aarch64 environment, but you won't be able to do much
with it.

This works much better if you install an arm userspace via
debootstrap, chroot into the arm userspace, and then compile code.
The arm userspace will have a native arm compiler.  I have this setup
on a dragonboard (jessie) and an APM Mustang (trusty) and it works
fine.  lxc/lxd also works on my trusty system, but I mostly use
schroot.  A hikey doesn't have as much disk/flash space as my
dragonboard though, so this might not be as convenient.

Jim
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to