Skip to content

Docker image to cross-compile linux for armhf (raspberry pi for instance)

License

Notifications You must be signed in to change notification settings

gokrazy-community/crossbuild-armhf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cross-compilation docker image for armhf (Raspberry Pi kernel)

This repository hosts a docker image for cross-compiling the Linux kernel image for the Raspberry Pi.

docker run --rm \
    -v /path/to/the/kernel:/root/armhf \
    ghcr.io/gokrazy-community/crossbuild-armhf:jammy-20220815 \
    make zImage

This image is used by https://github.com/gokrazy-community/kernel-rpi-os-32.


Unfortunately it is unsuitable to cross-compile go programs, since

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.

Have a look at https://github.com/Pro/raspi-toolchain for such usecases.

About

Docker image to cross-compile linux for armhf (raspberry pi for instance)

Resources

License

Stars

Watchers

Forks