Page MenuHomePhabricator

[CMAKE] Add cross compiling support for ARM32 and ARM64
ClosedPublic

Authored by Fabien on May 10 2019, 14:38.

Details

Summary

Add 2 new toolchain files for ARM cross compilation:

  • LinuxARM32 requires arm-linux-gnueabihf-gcc/g++
  • LinuxARM64 requires aarch64-linux-gnu-gcc/g++

The 32 bits binary has been tested on a RPI running raspbian.
The 64 bits binary has been tested on a RPI running Mate 18.04.

I did not test building bitcoin-qt. The build-unix.md instructions
for cross compiling suggest to not install Qt as part of the
dependencies, and this seems to be a rare use case for these targets.

Depends on D3017

Test Plan
mkdir buildcmake && cd buildcmake
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/LinuxARM32.cmake \

-DBUILD_BITCOIN_QT=OFF -GNinja ..

ninja
file src/bitcoind

The output of file should indicate the binary is 32 bits and compiled
for ARM

rm -rf *
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/LinuxARM64.cmake \

-DBUILD_BITCOIN_QT=OFF -GNinja ..

ninja
file src/bitcoind

The output of file should indicate the binary is 64 bits and compiled
for ARM

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_linux_arm
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5824
Build 9710: Bitcoin ABC Buildbot (legacy)
Build 9709: arc lint + arc unit

Event Timeline

deadalnix requested changes to this revision.May 12 2019, 23:27

ARM64 is typically called AArch64 and 32 just ARM

This revision now requires changes to proceed.May 12 2019, 23:27
This revision is now accepted and ready to land.May 16 2019, 15:51