Skip to content

Instantly share code, notes, and snippets.

@arturfog
Last active January 12, 2019 18:00
Show Gist options
  • Save arturfog/37e7a4acabf0ba88bf78462d0bf2cbaf to your computer and use it in GitHub Desktop.
Save arturfog/37e7a4acabf0ba88bf78462d0bf2cbaf to your computer and use it in GitHub Desktop.
cross compile
sudo apt install crossbuild-essential-armhf && sudo apt install crossbuild-essential-arm64
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf
sudo dpkg --print-foreign-architectures
-DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++
-DCMAKE_CXX_FLAGS:STRING="-Wno-unused-variable -Wno-unused-parameter" -DCMAKE_C_FLAGS:STRING="-Wno-unused-variable -Wno-unused-parameter"
sudo apt-get remove --purge `dpkg --get-selections | grep i386 | awk '{print $1}'`
sudo apt install arm-linux-gnueabihf-gcc
# add to sources.list
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb-src [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb-src [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial universe
deb-src [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial universe
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe
deb-src [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe
deb [arch=arm64,armhf] http://ports.ubuntu.com/ubuntu-ports/ xenial multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates multiverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment