ARM Cross compiler

Why is cross-compiling so difficult? Because the libraries aren’t there! - Cross Compile

ARM architecture

Do I need to add foreign architecture for cross-compiling? No, it is possible to install g++-arm-linux-gnueabihf without adding armhf architecture.

  • arm is the original Debian ABI for the ARM architecture. It is now considered obsolete and newer ports such as armel and armhf have replaced it.
  • armel is the default Debain port for the ARM architecture
  • armhf is a port that uses the “hard” Floating Point Unit.
$ dpkg --print-architecture           # list native architecture
$ dpkg --print-foreign-architectures  # list foreign architecture

Debian cross compilation tools

This may conflict with g++-multilib that is needed by (aptitude resolution)

3)     libc6-dev-i386 recommends gcc-multilib      
...
# install C/C++ compiler and standard libs
$ apt-get install g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf

# compile something
$ arm-linux-gnueabihf-g++ main.cpp

Setup cross library

TBC

pkg-config

This tool searches, so called, package config files (.pc) using PKG_CONFIG_LIBDIR environment variable.

$ sudo apt-get install -y pkg-config-arm-linux-gnueabi

Meson arm cross compilation

Running ARM programs under linux

Written on February 27, 2021, Last update on March 27, 2021
arm cross-compile