hem
Posts: 15
Joined: Thu May 31, 2018 7:25 am

QT 5.7 rpi3 cross compilation

Thu Jul 12, 2018 5:25 am

I am new to rpi and QT. I have tried cross compiling QT for Rpi3 using ubuntu 14.04 Vmware on my desktop, i followed following guides:

https://www.ics.com/blog/configuring-qt ... spberry-pi
https://wiki.qt.io/RaspberryPi2EGLFS

i have downloaded tolls-master (toolchain ) from github link as given in second link tutorial. i am getting following terminal output on executing ./configure command from my terminal



[email protected]:~/Qt5.7.0/5.7/Src/qtbase$ sudo ./configure -release -opengl es2 -device linux-rpi3-g++ -device-option CROSS_COMPILE=~/raspi/tools-master/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 -hostprefix ~/raspi/qt5pi -v



This is the Qt Open Source Edition.



You are licensed to use this software under the terms of

the GNU Lesser General Public License (LGPL) versions 3.

You are also licensed to use this software under the terms of

the GNU General Public License (GPL) versions 2.



You have already accepted the terms of the Open Source license.



DEFAULT_INCDIRS="/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/arm-linux-gnueabihf

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include/c++/4.8.3/backward

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/lib/gcc/arm-linux-gnueabihf/4.8.3/include

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/lib/gcc/arm-linux-gnueabihf/4.8.3/include-fixed

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/include

/home/sntd/raspi/sysroot/usr/include

/home/sntd/raspi/sysroot/usr/include/arm-linux-gnueabihf

"

DEFAULT_LIBDIRS="/home/sntd/raspi/sysroot/usr/lib

/home/sntd/raspi/sysroot/usr/lib/arm-linux-gnueabihf

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/lib/gcc/arm-linux-gnueabihf/4.8.3

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/lib/gcc/arm-linux-gnueabihf

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/lib/gcc

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/lib

/home/sntd/raspi/sysroot/lib/arm-linux-gnueabihf

/home/sntd/raspi/sysroot/lib

"

Creating qmake...

make: Nothing to be done for `first'.

Running configuration tests...

Found pkg-config from $PATH: /usr/bin/pkg-config

Note: PKG_CONFIG_LIBDIR automatically set to /home/sntd/raspi/sysroot/usr/lib/pkgconfig:/home/sntd/raspi/sysroot/usr/share/pkgconfig:/home/sntd/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig

Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/sntd/raspi/sysroot

Determining architecture... ()

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -pipe -Os -mthumb -mfloat-abi=hard --sysroot=/home/sntd/raspi/sysroot -g -Wall -W -fPIC -I. -I../../mkspecs/devices/linux-rpi3-g++ -o arch.o arch.cpp

Assembler messages:

Fatal error: invalid -march= option: `armv8-a+crc'

make: *** [arch.o] Error 2

Unable to determine architecture!



Could not determine the target architecture!

Turn on verbose messaging (-v) to see the final report.

Determining architecture... ()

g++ -c -pipe -g -Wall -W -fPIC -I. -I../../mkspecs/linux-g++ -o arch.o arch.cpp

g++ -o arch arch.o

Found architecture in binary

CFG_HOST_ARCH="x86_64"

CFG_HOST_CPUFEATURES=" mmx sse sse2"

System architecture: 'unknown'

Host architecture: 'x86_64'

Precompiled-headers support disabled.

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c

Assembler messages:

Fatal error: invalid -march= option: `armv6'

Symbol visibility control disabled.

Assembler messages:

Fatal error: invalid -march= option: `armv6'

Assembler messages:

Fatal error: invalid -march= option: `armv6'

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ --sysroot=/home/sntd/raspi/sysroot -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c

bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."

#error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."

^

Symbolic function binding disabled.

checking for C++11...

/home/sntd/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -pipe -Os -mthumb -mfloat-abi=hard --sysroot=/home/sntd/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rpi3-g++ -o c++11.o c++11.cpp

Assembler messages:

Fatal error: invalid -march= option: `armv8-a+crc'

make: *** [c++11.o] Error 2

C++11 disabled.

ERROR: Qt requires a C++11 compiler and yours does not seem to be that.

Please upgrade.




please help me in this

User avatar
topguy
Posts: 4938
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT 5.7 rpi3 cross compilation

Thu Jul 12, 2018 9:11 am

- You noted that the guide on wiki.qt.io didnt list 5.7 among tested versions.

hem
Posts: 15
Joined: Thu May 31, 2018 7:25 am

Re: QT 5.7 rpi3 cross compilation

Fri Jul 13, 2018 5:14 am

topguy wrote:
Thu Jul 12, 2018 9:11 am
- You noted that the guide on wiki.qt.io didnt list 5.7 among tested versions.
but in the first link they used Qt 5.7 and rpi3 and it worked for them and they followed wiki link only

User avatar
topguy
Posts: 4938
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT 5.7 rpi3 cross compilation

Fri Jul 13, 2018 10:18 am

The errors would imply that the toolchain you downloaded is wrong or that you have more than one toolchain downloaded and use the wrong one.
So double check that maybe.

Your ubuntuversion is also very old, but I cant say that it is a problem since you download the toolchain anyway.
but... when I think about it.. even during crosscompiling you still have to compile "qmake" for the host and that you do with the ubuntu compiler.
So maybe you should try this on a VM with Ubuntu 18.04 instead.

hem
Posts: 15
Joined: Thu May 31, 2018 7:25 am

Re: QT 5.7 rpi3 cross compilation

Fri Jul 13, 2018 1:18 pm

topguy wrote:
Fri Jul 13, 2018 10:18 am
The errors would imply that the toolchain you downloaded is wrong or that you have more than one toolchain downloaded and use the wrong one.
So double check that maybe.

Your ubuntuversion is also very old, but I cant say that it is a problem since you download the toolchain anyway.
but... when I think about it.. even during crosscompiling you still have to compile "qmake" for the host and that you do with the ubuntu compiler.
So maybe you should try this on a VM with Ubuntu 18.04 instead.
ohk i will try with ubuntu 18.04 and get back to you

hem
Posts: 15
Joined: Thu May 31, 2018 7:25 am

Re: QT 5.7 rpi3 cross compilation

Mon Jul 16, 2018 5:15 am

I have tried with new cross tool chain and QT 5.9.1 on same ubuntu version configure command worked but i am getting following errors in make command :


make[5]: *** [../../../../lib/libQt5EglFSDeviceIntegration.so.5.9.1] Error 1
make[5]: Leaving directory `/home/sntd/Qt5.9.1/5.9.1/Src/qtbase/src/plugins/platforms/eglfs'
make[4]: *** [sub-eglfsdeviceintegration-pro-make_first-ordered] Error 2
make[4]: Leaving directory `/home/sntd/Qt5.9.1/5.9.1/Src/qtbase/src/plugins/platforms/eglfs'
make[3]: *** [sub-eglfs-make_first] Error 2
make[3]: Leaving directory `/home/sntd/Qt5.9.1/5.9.1/Src/qtbase/src/plugins/platforms'
make[2]: *** [sub-platforms-make_first] Error 2
make[2]: Leaving directory `/home/sntd/Qt5.9.1/5.9.1/Src/qtbase/src/plugins'
make[1]: *** [sub-plugins-make_first] Error 2
make[1]: Leaving directory `/home/sntd/Qt5.9.1/5.9.1/Src/qtbase/src'
make: *** [sub-src-make_first] Error 2
[email protected]:~/Qt5.9.1/5.9.1/Src/qtbase$


any idea why i am getting these4 errros??

User avatar
topguy
Posts: 4938
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: QT 5.7 rpi3 cross compilation

Mon Jul 16, 2018 10:19 am

I believe the real error is printed above what you have cut out.

Return to “Raspbian”