5

I am currently trying to cross-compile Qt 5.7 for my Raspberry Pi 3. This is my first cross-compiling atempt, so please be kind. :)

On the Qt Wiki I found instructions for the Raspberry Pi 2, which I am currently trying to adapt.

The compile line for RasPi 2 is as follows:

./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option \
CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- \
-sysroot ~/raspi/sysroot -opensource -confirm-license -make libs \
-prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v

I replaced the option

-device linux-rasp-pi2-g++

by

-device linux-rpi3-g++

as I found within the raspi-tools folder.

Now I am stuck at the option

CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-

as in the ~/raspi/tools/ folder I cannot see any obviously raspi3-related entry. There is only the arm-bcm2708/ folder. Shouldn't there be some bcm2837 entry? Does that mean there is no support for RasPi 3 yet or am I missing something?

Thank you for any hints.

2 Answers2

3

After much struggle (the accepted solution does not work for me), I finally got to cross compile qt 5.6 for raspberry pi 3 on ubuntu. You basically need to follow this well known how to. Just be sure to use the following configure:

./configure -release -opengl es2 -device linux-rpi3-g++
-device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v -nomake examples -nomake tests -no-use-gold-linker

Andreas
  • 5,393
  • 9
  • 44
  • 53
fabry
  • 41
  • 7
  • Thank you for this. I wil try it the next weekend and if it works, I will mark is the preferred solution. –  Jan 03 '17 at 15:34
  • I don't get it -device `linux-rpi3-g++` is only available with qt5.7 right ? – DeadlyJesus Feb 03 '17 at 11:16
1

The arm-bcm2708/ folder is just a name. It contains several build tool chains. It's perfectly fine to use system-installed tool chains as well. So I installed the package g++-arm-linux-gnueabihf on my build machine (Debian GNU/Linux) and used this configure call:

./configure -release -opengl es2 -device linux-rpi3-g++ \
  -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- \
  -sysroot /home/fs/raspi/sysroot -opensource -confirm-license \
  -make libs -prefix /usr/local/qt5pi -extprefix /home/fs/raspi/qt5pi \
  -hostprefix /home/fs/raspi/qt5 -v
  • Have you tried to compile ICU as well with this cross-compiler? – Mark Jun 15 '16 at 07:33
  • @Mark: Not sure what you mean. I compiled qtbase and a little demo app I wrote to test the result. –  Jun 15 '16 at 11:08
  • I'm asking if you compiled also the QtWebkit which requires ICU. This is because there are some issues with the official cross-compiler: https://github.com/raspberrypi/tools/issues/41 – Mark Jun 15 '16 at 11:55
  • 2
    No sorry, I did not go that far since I do not need WebKit. .. But prefer QWebEngine. QtWebKit will not be living long. https://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html –  Jun 15 '16 at 18:47