-
Notifications
You must be signed in to change notification settings - Fork 119
Raspberry Pi Cross Build
Supported host Platforms:
- Raspberry Pi
- Windows
- Linux
- macOS
Download toolchains and sysroot
- http://gnutoolchains.com/raspberry/ (windows, sysroot included)
- http://www.jaredwolff.com/toolchains/ (macOS)
- https://github.com/raspberrypi/tools/tree/master/arm-bcm2708 (linux)
The default gcc is arm-linux-gnueabihf-gcc, sysroot is gcc sysroot. Set PATH
to include gcc dir export PATH=$GCC_BIN_DIR:$PATH
. Run ./avbuild.sh rpi ["arch1 arch2..."]
or CROSS_PREFIX=gcc_prefix SYSROOT=your_sysroot ./avbuild.sh rpi ["arch1 arch2..."]
. arch*
can be armv6, armv7 and armv8
Cross build using clang supports all host platforms, i.e. you can build on windows, linux, macOS for pi.
Requirements:
Ubuntu install: apt install clang-5.0 lld-5.0 # latest release
Homebrew install(for Apple clang + lld build): brew install llvm
If lld is found, gcc cross toolchain and CROSS_PREFIX
is not required. You can build on any host such as windows, linux and macOS
If lld is not found, gcc cross toolchain is required to invoke binutils such as strip, ld.
Examples:
- opensource clang + gcc binutils:
CROSS_PREFIX=gcc_prefix SYSROOT=your_sysroot ./avbuild.sh rpi armv6-clang-5.0
- system clang(apple on mac) + lld:
SYSROOT=your_sysroot ./avbuild.sh rpi armv7-clang
- opensource clang(including android toolchain) asm can not build swscale: https://travis-ci.org/wang-bin/avbuild/jobs/294735568, apple clang has no such problem. So prebuilt packages on sourceforge containing
-clang
are built without swscale, please use packages containing-appleclang
instead https://sourceforge.net/projects/avbuild/files/raspberry-pi/ffmpeg-3.4.1-raspberry-pi-appleclang-lite.tar.xz/download