Failed Cross-Compile: Bad Architecture
-
I've run into an issue cross-compiling for the Pi3 and using linux-rpi3-g++ as the device.
./configure -release -opengl es2 -device linux-rpi3-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
It appears as though it's specifying armv8-a+crc as the architecture, but it's not valid.
checking for OpenGL ES 2.0... /home/dayres/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a+crc -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -pipe -Os -mthumb -std=c++1z -mfloat-abi=hard --sysroot=/home/dayres/raspi/sysroot -O2 -Wall -W -fPIC -I. -I=/opt/vc/include -I=/opt/vc/include/interface/vcos/pthreads -I=/opt/vc/include/interface/vmcs_host/linux -I../../../mkspecs/devices/linux-rpi3-g++ -o opengles2.o opengles2.cpp arm-linux-gnueabihf-g++: error: unrecognized argument in option ‘-march=armv8-a+crc’ arm-linux-gnueabihf-g++: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv8-a iwmmxt iwmmxt2 native arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-std=c++1z’ Makefile:192: recipe for target 'opengles2.o' failed make: *** [opengles2.o] Error 1
I believe it is using the arm-linux-gnueabihf-g++ from the pi tools so I'm going to investigate further on that side.
Has anyone seen this and know the solution?
Regards,
Dave -
Hi and welcome to devnet,
You should search where this
+crc
is coming from. There's only the armv8-a that is available. -
Thank you! I'm excited to get started with QT on the Pi.
I did investigate and found it in the qtbase/mkspecs/devices/linux-rpi3-g++/qmake.conf file.
I removed the +crc and started getting an error stating that it was not able to determine the destination platform. Also, I'm still receiving the arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-std=c++1z’ error.
Regards,
Dave -
Which version of the cross-compiler are you using ?
-
It looks like gcc version 4.8.3 20140106 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11)
I just git cloned raspberrypi/tools as per https://wiki.qt.io/RaspberryPi2EGLFS and changed the -device parameter to linux-rpi3-g++ in the configure step.
Did I make a beginner mistake in doing it this way? First time I've done cross-compiling instead of compiling right on a device.
-
You should check and switch to the 4.9 version. Or replace the -std=c++1z option. It asks the compiler to use the latest standard available. IIRC for 4.8 it was c++1y
-
Just as an update....
I switched to the 4.9 and the error messages I was receiving went away even with leaving it at armv8-a+crc .
Now it's tossing lots of garbage characters and the below messages. I'm investigating currently.
Running configuration tests (phase 1)... /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: 1: /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++:ELF: not found /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: 2: /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: cannot open : No such file /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: 2: /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: @@@@@@00pp@p@@@4� 4� : not found /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: 3: /home/dayres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: Syntax error: word unexpected (expecting ")") Precompiled-headers support disabled. <---snip---> Configures lots of things correctly <---snip---> Makefile:193: recipe for target 'arch.o' failed 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="i386" CFG_HOST_CPUFEATURES="" System architecture: 'unknown' Host architecture: 'i386' checking for C++11...
Anyway, just wanted to provide an update on where I was... I'll see how I can make out tonight.
-
Did you do a full rebuild after you changed the compiler ?
-
@dayres said:
std=c++1z
https://gcc.gnu.org/projects/cxx-status.html#cxx1z
-c++std c++11 more preferred chose.