Raspbian Buster and Cross Toolchain for Linux and Mac OS 8.3.0

Debian 10 logo

Raspbian Buster is out. It seems it updated gcc from version 6.3.0 (used for Stretch) to gcc version 8.3.0. This is not always needed, but I had a lot of problems in the past related to using an outdated crosscompiler, or the one provided in the raspberry repo: https://github.com/raspberrypi/tools. I therefore built my own toolchain for Stretch, which I provided here, both for Linux and Mac OS.

I did the same for Buster: I built my own toolchain and I built many projects with it, like Qt, ffmpeg etc… Just place the toolchain in /opt/rpi (probably position independent) and you should be done. This toolchain should be 100% compatible with gcc provided by Buster.

Download cross toolchain GCC 6.3.0 for Stretch here.
Download Linux x64 cross toolchain GCC 8.3.0 here.
Download Mac OS cross toolchain GCC 8.3.0 here.

Bye 😉

46 thoughts on “Raspbian Buster and Cross Toolchain for Linux and Mac OS 8.3.0”

  1. Hi,
    Have you tried to build your custom toolchain for the new RaspiOS based on Debian 11 bullseye OS ?
    Your blog is always so interesting :-), thanks for sharing with us all this informations !

    Best regards

  2. Finally done, the simple-video works 🙂
    I had to copy files from the following folder:
    – 3rdparty/ffmpeg/ffmpeg_pi2/lib/
    – piomxtextures_qt_driver/mediaplayer/

  3. Mmh… not so much now… 🙂
    However, simply look for the library. I don't remember where, but I'd go under piomxtextures_qt_driver, as it is a Qt driver.

  4. ok, are you sure?
    Your manual tells different: "If you're interested in the Qt plugin, once built, you should have the new openmaxil plugin in your Qt install dir".

    Which files should i copy on the RPI to my /usr/local/qt5pi folder?

    There are several pot folders that contain *.so files, e.g.
    pot-5.7.3/3rdparty/ffmpeg/ffmpeg_pi2/lib/
    pot-5.7.3/piomxtextures_lib
    pot-5.7.3/piomxtextures_qt_driver/mediaplayer/
    pot-5.7.3/piomxtextures_src/omxplayer_lib/

  5. 1) OK, thanks
    2) OK, i repeated all steps and POT now seems to compile.
    But make-install installs nothing. Would you have a hint?

    Details:
    – qmake writes only one line:
    Info: creating stash file /home/niki/piview-dev/opt_qt_for_rpi/qt5.15.2/qtsrc/pot-5.7.3/.qmake.stash

    – make seems to run without errors, only some warnings about code

    – make-install writes "nothing to be done for 'install'" for each folder, e.g.:

  6. 1) They are only needed if you use protocols needing smb or ssl. Should not be needed for local files. I'm sorry, I don't remember the names of all the deps, probably also libssl-dev, libcrypto etc… but not sure, you should probably refer to ffmpeg docs.
    2) Are you sure prepare_openmaxil_backend.sh is even needed? According to https://thebugfreeblog.blogspot.com/p/build-procedure-for-piomxtextures.html it seems that is part of the old build procedure. ./prepare_3rdparty.sh seems to be the only one needed before building the plugin itself.

  7. You are using both versions in the script (RPI_COMPILER_PATH and COMPILER_PATH). It works now.

    I am stuck with two problems:

    1)
    Are the ffmpeg options libsmbclient and libssl really needed? There seem to be missing files on my computer, but i cannot find out libraries to install. Any hints except libsmbclient-dev?

    2)
    I think you changed the folder structure, so that i need to patch your "prepare_openmaxil_backend.sh" (lines 64/65). But how?

    cp -a build-PiOmxTextures/libPiOmxTextures* PiOmxTextures/lib
    => change like this?
    cp -a build-PiOmxTextures/piomxtextures_lib/libPiOmxTextures* PiOmxTextures/lib

    cp -a build-PiOmxTextures/piomxtextures/* PiOmxTextures/include
    => change to what?

    Thanks for your help. I really hope i get it to work. Your pot still seems to be the only option for HW accelerated videos with QT/QML.

    Nik

  8. Dear Luca,

    i managed to crosscompile QT5.15.2 for a raspberry pi2.
    Now, I am stuck at creating the pot-tools (v5.7.3).

    I am using your toolchain from here: https://bugfreeblog.page.link/rasplinuxgcc830

    I run "./prepare_3rdparty.sh pi2" which calls ./configure for ffmpeg.

    This fails with:
    arm-linux-gnueabihf-gcc is unable to create an executable file.
    C compiler test failed.

    Some lines from the ffmpeg config.log are:
    ..
    COMPILER_PATH='/opt/rpi/rpi-gcc-8.3.0/bin'
    ..
    WARNING: Unknown C compiler arm-linux-gnueabihf-gcc, unable to select optimal CFLAGS
    ..
    arm-linux-gnueabihf-gcc -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -funsafe-math-optimizations -lm -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog -E -o /tmp/ffconf.cc8oXqK7/test.o /tmp/ffconf.cc8oXqK7/test.c
    ./configure: 906: ./configure: arm-linux-gnueabihf-gcc: not found
    ..
    C compiler test failed.

    If i run /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-gcc then i get "arm-linux-gnueabihf-gcc: fatal error: no input files". So i assume, it is finding the compiler at least.

    I'd appreciate your help.
    Nik

  9. Dear Luca,
    i am trying to use your toolchain (Linux x64) to crosscompile QT5.15.2 for the raspberry 2, Buster.
    Would you please give some advice.
    Previously i used the toolchain from: https://github.com/raspberrypi/tools
    Now, i only changed the compiler line in my ./configure.sh to point to your toolchain in /opt/rpi/

    Project ERROR: Cannot run target compiler '/opt/rpi/bin/arm-linux-gnueabihf-gcc-8.3.0g++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?

  10. Thank you for the response.
    I can make a minimal app that works without multimedia.

    Tha readelf gives me:

    Attribute Section: aeabi
    File Attributes
    Tag_CPU_name: "8-A"
    Tag_CPU_arch: v8
    Tag_CPU_arch_profile: Application
    Tag_ARM_ISA_use: Yes
    Tag_THUMB_ISA_use: Thumb-2
    Tag_FP_arch: VFPv2

    when I check a random lib I got

    Attribute Section: aeabi
    File Attributes
    Tag_CPU_name: "6"
    Tag_CPU_arch: v6
    Tag_ARM_ISA_use: Yes
    Tag_THUMB_ISA_use: Thumb-1
    Tag_FP_arch: VFPv2

    Maybe I make a mistake and compile QT as armv8 instead of armv6? I tought it should be armv7. Anyway I will study more about it ..

  11. Is a minimal Qt app working properly? Does the app work without multimedia?
    Maybe wrong arch? What is readelf -a saying about /usr/local/qt5pi/plugins/video/videonode/libeglvideonode.so?

  12. Thank you for this amazing work.
    I used this toolchain to cross compile POT, QT 5.12.5 and my QT application.
    It is a QT QML project that plays one video.

    It copied qt_driver to mediaservice and I think it is all in the rigth place.
    But my application could not run. It always stop in the problema above.
    I hope maybe someone could read this and give me some light.

    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/video/videonode" …
    QFactoryLoader::QFactoryLoader() looking at "/usr/local/qt5pi/plugins/video/videonode/libeglvideonode.so"
    Found metadata in lib /usr/local/qt5pi/plugins/video/videonode/libeglvideonode.so, metadata=
    {
    "IID": "org.qt-project.qt.sgvideonodefactory/5.2",
    "MetaData": {
    "Keys": [
    "egl"
    ]
    },
    "archreq": 0,
    "className": "QSGVideoNodeFactory_EGL",
    "debug": false,
    "version": 330752
    }

    Got keys from plugin meta data ("egl")
    QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/video/videonode" …
    loaded library "/usr/local/qt5pi/plugins/video/videonode/libeglvideonode.so"
    Requesting control for org.qt-project.qt.videorenderercontrol/5.0…
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/accessible" …
    QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/accessible" …
    QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qt5pi/plugins/accessiblebridge" …
    QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/accessiblebridge" …
    Bus error

  13. I use this toolchain t crosscompile Qt5.12.5 for raspberry pi4 on Ubuntu 18.04 and I have this error on compile time:

    /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf-g++ -c -include .pch/Qt5Core -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard –sysroot=/opt/rpi/buster_enigma/sysroot/ -O3 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I. -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty/forkfd -I../3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.12.5 -I../../include/QtCore/5.12.5/QtCore -I.moc -I.tracegen -isystem /opt/rpi/buster_enigma/sysroot/usr/include/glib-2.0 -I/opt/rpi/buster_enigma/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include -isystem /opt/rpi/buster_enigma/sysroot/usr/include -I/opt/rpi/buster_enigma/sysroot/opt/vc/include -I../../mkspecs/devices/linux-rasp-pi3-vc4-g++ -o .obj/qlockfile_unix.o io/qlockfile_unix.cpp
    io/qfilesystemengine_unix.cpp: En la función ‘int qt_statx(const char*, statx*)’:
    io/qfilesystemengine_unix.cpp:323:26: error: ‘AT_FDCWD’ no se declaró en este ámbito
    return qt_real_statx(AT_FDCWD, pathname, 0, statxBuffer);

  14. I used this toolchain to crosscompile Qt5.12.5 for raspberry pi4 with these modules: qtdeclarative qtquickcontrols qtquickcontrols2 qtmultimedia qtsvg qtxmlpatterns qtgraphicaleffects qtwebsockets. It works like a charm!

Leave a Reply

Your email address will not be published. Required fields are marked *