Cross compile from Ubuntu Desktop to Raspberry Pi 2
-
I also got the same error when cross compile Qt samples for Raspberry Pi 3 on Ubuntu 16.04 (64-bit). I'm using Qt Creator 5.8.
I got this error on both Raspbian 1.1 and Ubuntu Mate 16.04.2.
-
I managed to cross compile Qt 5.8 for the Raspberry Pi 3 (latest Raspbian) with the xbomber tip from this post (at the end): https://github.com/raspberrypi/tools/issues/50
Was following the EGLFS guide ( https://wiki.qt.io/RaspberryPi2EGLFS ) on a Linux Mint 17.3 x64 virtual machine.
I used the linux-rasp-pi2-g++ device configuration and the arm-rpi-4.9.3-linux-gnueabihf toolchain.
Used the Qt 5.8 source tar.gz without the qtserialbus and qtwebengine -
I managed to cross compile Qt 5.8 for the Raspberry Pi 3 (latest Raspbian) with the xbomber tip from this post (at the end): https://github.com/raspberrypi/tools/issues/50
Was following the EGLFS guide ( https://wiki.qt.io/RaspberryPi2EGLFS ) on a Linux Mint 17.3 x64 virtual machine.
I used the linux-rasp-pi2-g++ device configuration and the arm-rpi-4.9.3-linux-gnueabihf toolchain.
Used the Qt 5.8 source tar.gz without the qtserialbus and qtwebengine@hubaiz Looking promising!
I just wonder, the second script, is there anything else i need to change than the path to tools and sysroot when targeting qt5.8 and raspberry 3?i changed the paths and ran the script in qtbase but got errors.
Running configuration tests... Checking for valid makespec... + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && /home/christian/raspi/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/christian/raspi/sysroot" -early "CONFIG += cross_compile" /home/christian/raspi/qtbase/config.tests/common/verifyspec + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make > rm -f verifyspec.o > rm -f *~ core *.core > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I/home/christian/raspi/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o verifyspec.o verifyspec.cpp > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/christian/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/christian/raspi/sysroot/usr/lib/ -Wl,-rpath-link,/home/christian/raspi/sysroot/lib/ -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -Wl,-O1 -o verifyspec verifyspec.o > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm > collect2: error: ld returned 1 exit status > Makefile:65: recipe for target 'verifyspec' failed > make: *** [verifyspec] Error 1 Note: Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
Got any idea whats wrong?
-
@hubaiz Looking promising!
I just wonder, the second script, is there anything else i need to change than the path to tools and sysroot when targeting qt5.8 and raspberry 3?i changed the paths and ran the script in qtbase but got errors.
Running configuration tests... Checking for valid makespec... + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && /home/christian/raspi/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/christian/raspi/sysroot" -early "CONFIG += cross_compile" /home/christian/raspi/qtbase/config.tests/common/verifyspec + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make > rm -f verifyspec.o > rm -f *~ core *.core > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I/home/christian/raspi/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o verifyspec.o verifyspec.cpp > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/christian/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/christian/raspi/sysroot/usr/lib/ -Wl,-rpath-link,/home/christian/raspi/sysroot/lib/ -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -Wl,-O1 -o verifyspec verifyspec.o > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm > collect2: error: ld returned 1 exit status > Makefile:65: recipe for target 'verifyspec' failed > make: *** [verifyspec] Error 1 Note: Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
Got any idea whats wrong?
-
I ran into this a few weeks ago when upgrading from Qt 5.7 to 5.8 and following the wiki's instructions. I added
-skip qtwebengine -no-icu
when I ran./configure
because I don't need those features in my app and it worked fine after that. -
I ran into this a few weeks ago when upgrading from Qt 5.7 to 5.8 and following the wiki's instructions. I added
-skip qtwebengine -no-icu
when I ran./configure
because I don't need those features in my app and it worked fine after that.@StoatPatronus Did you put it in the script? I get an error when i try to run it:
ERROR: Unknown command line option '-skip'.
Have tried to put in the beginning and in the end of the script, but i guess as long it doesn't know what it is that does not matter.
-
@StoatPatronus Did you put it in the script? I get an error when i try to run it:
ERROR: Unknown command line option '-skip'.
Have tried to put in the beginning and in the end of the script, but i guess as long it doesn't know what it is that does not matter.
-
@jsulm Sure!
It's this script:
#!/bin/sh ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/marco/Qt/5.3/tools-master/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /home/marco/Qt/5.3/sysroot -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi -v
With the "-skip qtwebengine -no-icu" added. I've tried right in the beginning after ./configure, in the end and after "-opensource". Neither worked.
-
I was having the same issue and reconfigured with just the -no-icu flag and everything worked fine (I use qtwebengine in my app) my config string 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-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -no-icu -hostprefix ~/raspi/qt5 -v
-
@jsulm Sure!
It's this script:
#!/bin/sh ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/marco/Qt/5.3/tools-master/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /home/marco/Qt/5.3/sysroot -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi -v
With the "-skip qtwebengine -no-icu" added. I've tried right in the beginning after ./configure, in the end and after "-opensource". Neither worked.
@Fifkie Here's my command line, please replace the {{ stuff in brackets }} with the paths for your system:
./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE={{pi_folder}}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot {{pi_folder}}/sysroot -opensource -confirm-license -skip qtwebengine -no-icu -make libs -prefix /usr/local/qt5pi -extprefix {{pi_folder}}/qt5pi -hostprefix {{pi_folder}}/qt5
One thing I noticed in the config string you posted is it looks like Qt 5.3 (
/home/marco/Qt/5.3/...etc
) which I haven't tried - I only tried with 5.8. -
@Fifkie Here's my command line, please replace the {{ stuff in brackets }} with the paths for your system:
./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE={{pi_folder}}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot {{pi_folder}}/sysroot -opensource -confirm-license -skip qtwebengine -no-icu -make libs -prefix /usr/local/qt5pi -extprefix {{pi_folder}}/qt5pi -hostprefix {{pi_folder}}/qt5
One thing I noticed in the config string you posted is it looks like Qt 5.3 (
/home/marco/Qt/5.3/...etc
) which I haven't tried - I only tried with 5.8.@StoatPatronus Now as i review the script i posted, i must have just copied that from the tut, not from the script i use because there are several things not matching. But I got Kukkimonsuta's tutorial working for me so i got it working now. For anyone else looking for a solution just follow the steps at https://github.com/Kukkimonsuta/rpi-buildqt . Only thing i had to change was with one of the scripts i got an error that it didn't have the permission to sync one folder from the RPI. So in the sync script i just added
--exclude 'vnc'
in the rsync under "== Copy /usr/lib =="
That's because it wouldn't sync the vnc-folder. -
@StoatPatronus Now as i review the script i posted, i must have just copied that from the tut, not from the script i use because there are several things not matching. But I got Kukkimonsuta's tutorial working for me so i got it working now. For anyone else looking for a solution just follow the steps at https://github.com/Kukkimonsuta/rpi-buildqt . Only thing i had to change was with one of the scripts i got an error that it didn't have the permission to sync one folder from the RPI. So in the sync script i just added
--exclude 'vnc'
in the rsync under "== Copy /usr/lib =="
That's because it wouldn't sync the vnc-folder.@Fifkie I'm glad you got it working. Kukkimonsuta's guide is very helpful. For my project I wrote a couple Ansible playbooks to automate the process, so it's easy to upgrade to new versions of Qt in the future. Unfortunately I can't share them at this point, but I may later if I clean them up.
-
@StoatPatronus Now as i review the script i posted, i must have just copied that from the tut, not from the script i use because there are several things not matching. But I got Kukkimonsuta's tutorial working for me so i got it working now. For anyone else looking for a solution just follow the steps at https://github.com/Kukkimonsuta/rpi-buildqt . Only thing i had to change was with one of the scripts i got an error that it didn't have the permission to sync one folder from the RPI. So in the sync script i just added
--exclude 'vnc'
in the rsync under "== Copy /usr/lib =="
That's because it wouldn't sync the vnc-folder.I cleaned up my ansible playbooks and posted them at https://bitbucket.org/johnwoltman/build_qt_for_pi_with_ansible