Cannot configure Qt 5.3.1 and 5.3.2 for arm cross-compile
-
Greetings! I've used Qt 5.2.1 on my embedded linux system and now I want to upgrade it to 5.3.2 (or 5.3.1). Unfortunately, I have encountered some error on configuration stage. Please, take a look into details:
( CROSS_COMPILE is defined correctly in environment variables )
So, I have a modified qmake.conf in /qtbase/mkspecs/linux-arm-gnueabi-g++
@qmake configuration for building with arm-linux-gnueabi-g++
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental gdb_dwarf_index
QMAKE_INCREMENTAL_STYLE = sublibinclude(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)QT_QPA_DEFAULT_PLATFORM = eglfs
modifications to g++.conf
QMAKE_CC = $${CROSS_COMPILE}gcc
QMAKE_CXX = $${CROSS_COMPILE}g++
QMAKE_LINK = $${QMAKE_CXX}
QMAKE_LINK_SHLIB = $${QMAKE_CXX}QMAKE_CFLAGS += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-strict-aliasing
QMAKE_CXXFLAGS += $$QMAKE_CFLAGSQMAKE_LIBDIR += /home/uki/tslib-master/src/.libs/
/usr/local/lib/QMAKE_INCDIR += /home/uki/tslib-master/src/
QMAKE_LIBS += -licui18n -licuuc -licudata
QMAKE_INCDIR_OPENGL_ES2 = /media/Work1/dvsdk/graphics-sdk_4.03.00.02/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include
QMAKE_INCDIR_OPENGL = $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_INCDIR_X11 = /usr/include/QMAKE_LIBDIR_OPENGL_ES2 = /media/Work1/dvsdk/graphics-sdk_4.03.00.02/gfx_rel_es2.x
QMAKE_LIBDIR_OPENGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR_X11 = /usr/local/lib/QMAKE_INCDIR_EGL = $$QMAKE_INCDIR_OPENGL
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGLQMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $$QMAKE_LIBS_EGL
#QMAKE_LIBS_X11 = -lxcb -lXauQMAKE_LIBS_LIBUDEV = -ludev
modifications to linux.conf
QMAKE_AR = $${CROSS_COMPILE}ar cqs
QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
QMAKE_NM = $${CROSS_COMPILE}nm -P
QMAKE_STRIP = $${CROSS_COMPILE}stripload(qt_config)
@And my configuration script (running on Ubuntu 10.04 LTS 32bit):
@
./configure -prefix /opt/qt-5.3.1/ -xplatform linux-arm-gnueabi-g++ -release -opensource -confirm-license
-make libs -nomake examples -nomake tests -no-c++11 -shared -accessibility -no-pch -no-largefile
-qpa eglfs -eglfs -linuxfb -no-audio-backend -sysroot /media/home/root/ubi
-qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -opengl es2 -verbose
-nis -no-cups -no-dbus -no-avx -no-glib -tslib -icu
-I /home/uki/icu-cross/source/common/ -I /home/uki/icu-cross/source/i18n/ -I /home/uki/icu-cross/source/io/
-L /home/uki/icu-cross/source/lib
@gcc toolchain for cross-compiling is Sourcery G++ Lite 2010.09-50 (gcc 4.5.1)
For 5.2.1, it is OK. For 5.3.x, I'm getting error on configuration:
@
Determining architecture... ()
g++ -c -pipe -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fno-strict-aliasing --sysroot=/media/home/root/ubi -g -Wall -W -fPIE -I../../mkspecs/linux-arm-gnueabi-g++ -I. -I../../../../icu-cross/source/common -I../../../../icu-cross/source/i18n -I../../../../icu-cross/source/io -I../../../../tslib-master/src -o arch.o arch.cpp
cc1plus: error: unrecognized command line option "-mfpu=neon"
cc1plus: error: unrecognized command line option "-mfloat-abi=softfp"
arch.cpp:1: error: bad value (armv7-a) for -march= switch
arch.cpp:1: error: bad value (cortex-a8) for -mtune= switch
make: *** [arch.o] Error 1
Unable to determine architecture!
@I don't understand, why plain g++ was called here instead of arm-none-linux-gnueabi-g++ ... what have I missed in qmake.conf/run script?
-
Hi,
Can you show your call to configure with all the options your gave ?
-
Did you mean output? If yes, then sure:
In addition, "first run" output on clean qt distro
-
IIRC you need to something like
@-device-option CROSS_COMPILE=/opt/gcc-4.7-linaro-gnueabihf/bin/arm-linux-gnueabihf-@
Update the path for your toolchain
-
I already have proper CROSS_COMPILE in environments, it works fine for Qt versions 5.2 and below.
Nevertheless, I've added experimental '-device-option' that you mentioned. Unfortunately, It changes nothing in my case.
-
Since 5.4 is out, can you check with it ?
-
Yes, I've checked it, and there is no difference with 5.3 and 5.4
In Qt mailing list, there is a suggestion that I would check on monday:
bq. -mcpu=cortex-a8
instead of
-march=armv7-a -mtune=cortex-a8 -
UPDATE: unfortunately, change mentioned above don't help.
Also, I've tried another toolchain (2011.09-70 instead of 2010.09-50) , whith no effect too.Moreover, I guess these compile options is not the real reason. I have removed them at all, and got a totally confusing log. Looks like compiler cannot found almost anything... Why it works fine with 5.2.1 and fails so in later versions, I don't understand...
-
Looks like you are missing some dependencies for nis