Cross compiling Qt for RaspBerryPi3- unknown CPU architecture



  • Hi

    I m using ubuntu 12.04

    Following RaspberryPi2EGLFS steps for compilation.
    command used for compiling
    ./configure -release -opengl es2 -device linux-rpi3-vc4-g++ -device-option CROSS_COMPILE=/root/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /root/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /root/raspi/qt5pi -hostprefix /root/raspi/qt5 -v

    Error:
    /root/raspi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: /root/raspi/qt5/qtbase/lib/libqtpcre.a(pcre16_chartables.o): unknown CPU architecture
    collect2: error: ld returned 1 exit status

    make[2]: *** [../../lib/libQt5Core.so.5.6.3] Error 1
    make[2]: Leaving directory /root/raspi/qt5/qtbase/src/corelib' make[1]: *** [sub-corelib-make_first] Error 2 make[1]: Leaving directory/root/raspi/qt5/qtbase/src'
    make: *** [sub-src-make_first] Error 2


    Which device option should be used for raspberrypPi3 as mkspecs/devices has
    linux-rasp-pi-g++
    linux-rpi3-g++
    linux-rpi3-vc4-g++
    Where can we get clear description of each option



  • @yuvaram You're mixing toolchains. That is an error that comes from using the host compiler for some things and the cross compiler for others.

    Clean your build environment and make sure your CROSS_COMPILE is set correctly and your sysroot has the proper libs that were built for the Pi.



  • @ambershark thank you.

    How can i check host compiler or cross compilers are getting used.


  • Lifetime Qt Champion

    Hi,

    First thing, did you call configure while you already used these sources to build another version of Qt ?

    Second, don't work as root. There's no safety check done and thus you could brick your computer.



  • @yuvaram Best bet is to just clean your entire environment... I.e. extract Qt from the source tarball into a new directory and start over with your configure line.

    You can also try running make with verbose, i.e. make VERBOSE=1 to see if there is more information.

    And finally you can check your output objects with the file command. It will show something like this ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped, with debug_info. That tells me it's build for x86-64. So if you see that on your objects then you are building without the cross compiler.

    Oh and what @SGaist said about not being root is a really good idea. Almost nothing in linux should be done as root unless you need to elevate your privileges for a single command. I.e when you go to install Qt you could sudo make install to be root for that one command. I wouldn't do that on this build though as it's for the ARM platform and you don't want to really install it on your system. ;)



  • @ambershark Thank you.
    i will do that and get back to you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.