AnsweredAssumed Answered

Cross compilation issue with QT5.6 and imx6

Question asked by pierre zouz on May 24, 2016
Latest reply on Aug 9, 2016 by pierre zouz

Hi,

 

I'm struggling a lot to cross-compile QT-5.6. Did anyone succeed to do it ?

 

qmake.conf

include(../common/linux_device_pre.conf)

 

 

ROOTFS=/mnt/hd

 

 

EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp

 

 

QMAKE_LIBS_EGL         += -lEGL

QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL -lGAL

QMAKE_LIBS_OPENVG      += -lOpenVG -lEGL -lGAL

 

 

IMX6_CFLAGS            = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1

QMAKE_CFLAGS           += $$IMX6_CFLAGS

QMAKE_CXXFLAGS         += $$IMX6_CFLAGS

QMAKE_LFLAGS           += -Wl,-rpath-link,$$ROOTFS/usr/lib

 

 

IMX6_CFLAGS_RELEASE     = -O2 $$IMX6_CFLAGS

QMAKE_CFLAGS_RELEASE   += $$IMX6_CFLAGS_RELEASE

QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS_RELEASE

QMAKE_CFLAGS_DEBUG     += $$IMX6_CFLAGS

QMAKE_CXXFLAGS_DEBUG   += $$IMX6_CFLAGS

 

 

# Preferred eglfs backend

EGLFS_DEVICE_INTEGRATION = eglfs_viv

 

 

QMAKE_INCDIR           += $$ROOTFS/usr/include

QMAKE_LIBDIR           += $$ROOTFS/usr/lib

QMAKE_INCDIR_OPENGL_ES2+= $$ROOTFS/usr/include/GLES2

QMAKE_LIBDIR_OPENGL_ES2+= $$ROOTFS/usr/lib

QMAKE_LIBS             += -L/mnt/hd/usr/lib -lgthread-2.0 -lgio-2.0 -lglib-2.0 -lgmodule-2.0 -lgobject-2.0 -lgstbase-0.10 -lgstcontroller-0.10 -lgstreamer-0.10 -lz -lffi -lxml2 -llzma -lm -lmms

 

 

include(../common/linux_arm_device_post.conf)

load(qt_config)

 

 

My configure settings

 

export PKG_CONFIG_SYSROOT_DIR=/mnt/hd

export PKG_CONFIG_LIBDIR=/mnt/hd/usr/lib/pkgconfig/

 

 

 

./configure -v -opensource -confirm-license -qt-zlib -no-use-gold-linker -no-reduce-relocations -no-pch -no-xcb -no-opengl -opengl es2 -glib -gstreamer -pkg-config -no-directfb \

-no-cups  -no-dbus -no-icu  -no-android-style-assets -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2  -no-sql-tds \

-make libs -device imx6 \

-compile-examples \

-device-option CROSS_COMPILE=/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- \

-sysroot /mnt/hd -no-gcc-sysroot \

-prefix /tmp/qtinstallqt5 \

-skip xmlpatterns -skip winextras -skip webview -skip websockets -skip webengine -skip webchannel -skip wayland -skip serialport -skip serialbus -skip sensors -skip quickcontrols2 -skip multimedia -skip macextras -skip androidextras

                                                                                                         

 

And errors

[...]

Running configuration tests (phase 1)...

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c

Symbol visibility control enabled.

DEFAULT_INCDIRS="/usr/lib64/qt/include

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/include/c++/4.9.2

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/include/c++/4.9.2/arm-linux-gnueabihf

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/include/c++/4.9.2/backward

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/lib/gcc/arm-linux-gnueabihf/4.9.2/include

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/lib/gcc/arm-linux-gnueabihf/4.9.2/include-fixed

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/include

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/usr/include

"

DEFAULT_LIBDIRS="/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/lib

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/lib

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/arm-linux-gnueabihf/libc/usr/lib

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/lib/gcc/arm-linux-gnueabihf/4.9.2

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/lib/gcc/arm-linux-gnueabihf

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/lib/gcc

"

Done running configuration tests.

<srcbase> = /tmp/qt5/qtbase

<outbase> = /tmp/qt5/qtbase

Creating qmake...

gmake: Nothing to be done for `first'.

Running configuration tests (phase 2)...

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

Determining architecture... ()

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=softfp -g -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -Wall -W -fPIC  -I. -I/mnt/hd/usr/include -I../../mkspecs/devices/linux-imx6-g++ -o arch.o arch.cpp

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/mnt/hd/usr/lib -mfloat-abi=softfp -o arch arch.o   -L/mnt/hd/usr/lib -lgthread-2.0 -lgio-2.0 -lglib-2.0 -lgmodule-2.0 -lgobject-2.0 -lgstbase-0.10 -lgstcontroller-0.10 -lgstreamer-0.10 -lz -lffi -lxml2 -llzma -lm -lmms

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /lib/libc.so.6 when searching for /lib/libc.so.6

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/libc.so.6

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/libc_nonshared.a

/tmp/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/ld-linux.so.3

collect2: error: ld returned 1 exit status

gmake: *** [arch] Error 1

Unable to determine architecture!

[...]

And I got a lot of like this.

 

Help appreciated

 

Cheers

Outcomes