All Projects → Pro → Raspi Toolchain

Pro / Raspi Toolchain

Labels

Projects that are alternatives of or similar to Raspi Toolchain

Burst
То, чего нет в Бусте
Stars: ✭ 72 (-20%)
Mutual labels:  cmake
Cotire
CMake module to speed up builds.
Stars: ✭ 1,212 (+1246.67%)
Mutual labels:  cmake
Torchlambda
Lightweight tool to deploy PyTorch models to AWS Lambda
Stars: ✭ 83 (-7.78%)
Mutual labels:  cmake
Fcnpc
FCNPC - Fully Controllable NPC
Stars: ✭ 73 (-18.89%)
Mutual labels:  cmake
Helloworld
A C++ Hello World project, using CMake, and GitHub Actions
Stars: ✭ 77 (-14.44%)
Mutual labels:  cmake
Leathers
🚀 Warning suppression library (C++)
Stars: ✭ 78 (-13.33%)
Mutual labels:  cmake
Ncnn Benchmark
The benchmark of ncnn that is a high-performance neural network inference framework optimized for the mobile platform
Stars: ✭ 70 (-22.22%)
Mutual labels:  cmake
Aws Robomaker Small Warehouse World
This Gazebo world is well suited for organizations who are building and testing robot applications for warehouse and logistics use cases.
Stars: ✭ 85 (-5.56%)
Mutual labels:  cmake
Findtbb
CMake find module for Intel Threading Building Blocks
Stars: ✭ 77 (-14.44%)
Mutual labels:  cmake
Progress Cpp
A flexible ASCII progress-bar for C++
Stars: ✭ 81 (-10%)
Mutual labels:  cmake
Cmake Modules
CMake modules for some scientific libraries
Stars: ✭ 75 (-16.67%)
Mutual labels:  cmake
Cmake.vim
🔨 CMake functionality within Vim.
Stars: ✭ 76 (-15.56%)
Mutual labels:  cmake
Gr Elster
A GNU Radio block that decodes packets transmitted by Elster R2S smart meters
Stars: ✭ 78 (-13.33%)
Mutual labels:  cmake
Gpu Icp Slam
Stars: ✭ 73 (-18.89%)
Mutual labels:  cmake
Gr Nordic
GNU Radio module and Wireshark dissector for the Nordic Semiconductor nRF24L Enhanced Shockburst protocol.
Stars: ✭ 84 (-6.67%)
Mutual labels:  cmake
Hacktoberfest2020
Contribute for hacktoberfest 2020
Stars: ✭ 72 (-20%)
Mutual labels:  cmake
Hpp Skel
Skeleton for C++ header-only libraries
Stars: ✭ 78 (-13.33%)
Mutual labels:  cmake
Novuscore
A modern take on WoW emulation
Stars: ✭ 88 (-2.22%)
Mutual labels:  cmake
Mingw W64 Cmake
CMake-based MinGW-w64 Cross Toolchain
Stars: ✭ 84 (-6.67%)
Mutual labels:  cmake
Llvm Amdgpu Assembler Extra
LLVM AMDGPU Assembler Helper Tools
Stars: ✭ 80 (-11.11%)
Mutual labels:  cmake

Rasperry PI Toolchains

Repository for Raspberry PI cross compiler using the new GCC8 and GCC9 for Raspbian Buster. This supports all new Raspberry PIs (ARMv7), and the older ones, including Zero, A, B, B+ (ARMv6) with newer GCCs.

You can probably also use this repository for any other ARMv6 and ARMv7 devices.

By default, newer GCC versions do not create correct binaries for ARMv6. Even though you pass the correct -mcpu= flag to gcc, it will create startup code for the newer ARMv7 architecture. Running them on your RasPI Zero will cause an "Illegal Instruction" exception.

See also: https://stackoverflow.com/questions/55465118/gcc-8-cross-compiler-outputs-armv7-executable-instead-of-armv6

This work is based on the great @tttapa and the Docker file here: https://gist.github.com/tttapa/534fb671c5f6cced0e1722d3e4aec987

A corresponding Blog post can be found here: https://solarianprogrammer.com/2018/05/06/building-gcc-cross-compiler-raspberry-pi/

A similar project can also be found here, but it only includes the compiled toolchains, which did not work out of the box for me: https://sourceforge.net/projects/raspberry-pi-cross-compilers

How to get the toolchain

You have two options:

  • Use the prebuilt toolchain attached to every github release (recommended)
  • Build the toolchain yourself

Use pre-built toolchain

Every github release has a pre-build toolchain attached. See

  1. Download the toolchain:
wget https://github.com/Pro/raspi-toolchain/releases/latest/download/raspi-toolchain.tar.gz
  1. Extract it. Note: The toolchain has to be in /opt/cross-pi-gcc since it's not location independent.
sudo tar xfz raspi-toolchain.tar.gz --strip-components=1 -C /opt
  1. You are done!

Build the toolchain from source

To build the toolchain, just clone this repository and then call:

docker build -f Dockerfile --network=host -t gcc9-rpi-zero .

This will take some time since it builds a docker container with the gcc compiler.

To run the docker container, use

docker run -it gcc9-rpi-zero bash

Install from source after building

To get the toolchain from the docker container into your host, just copy the files:

CONTAINER_ID=$(docker create gcc9-rpi-zero)
sudo docker cp $CONTAINER_ID:/opt/cross-pi-gcc /opt/cross-pi-gcc

It's important that you put the files into the same directory, since the toolchain has the paths hardcoded inside.

After that feel free to delete the docker container.

Test the toolchain

This repository contains a simple hello world example.

To cross-compile any executable after you installed the toolchain on your host, you need to get the current libraries and include files from your raspberry:

# Use the correct IP address here
rsync -vR --progress -rl --delete-after --safe-links [email protected]:/{lib,usr,etc/ld.so.conf.d,opt/vc/lib} $HOME/rpi/rootfs

Then call the script build_hello_world.sh.

To test the executable, copy it to your raspi:

scp build/hello [email protected]:/home/pi/hello
ssh [email protected]
./hello
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].