Qt5 for imx6
-
Hi. I'm trying to cross-compile Qt 5.12.0, but compilation was excepted with message:
In file included from ../../../include/QtCore/qglobal.h:1:0, from ../../../mkspecs/linux-g++/qplatformdefs.h:45, from ../../corelib/io/qfsfileengine_p.h:54, from ../../corelib/io/qfsfileengine.cpp:41: ../../../include/QtCore/../../src/corelib/global/qglobal.h:121:49: error: static assertion failed: Unsupported: read/write return a type with different size as the len parameter # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^ ../../corelib/io/qfsfileengine.cpp:88:1: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ Q_STATIC_ASSERT_X(sizeof(SignedIOType) == sizeof(UnsignedIOType),
here is my config parameters:
-opensource -confirm-license \ -device imx6 \ -device-option CROSS_COMPILE=arm-linux-gnueabihf- \ -sysroot /home/eugene/qt5/sysroot \ -prefix / \ -release \ -shared \ -no-gcc-sysroot \ -no-opengl \ -no-xcb \ -nomake tools \ -nomake tests \ -nomake examples \ -no-use-gold-linker \ -v
Any ideas?
Thanks! -
Hi,
What version of gcc are you using to build Qt ?
-
@SGaist I tried just now another toolchain: gcc-arm-none-eabi-7-2018-q2-update
But I had got excepted configuration process:> /home/eugene/qt5/cache/gcc-arm-none-eabi-7-2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/hard/libc.a(lib_a-exit.o): In function `exit': > exit.c:(.text.exit+0x2c): undefined reference to `_exit'
I tried to do workaround:
export QMAKE_LFLAGS="--specs=nosys.specs"
but without success (nothing changes)
-
At which point do you get that error ?
-
@SGaist Well, I removed and deleted all packages and arm-toolchains. Then I did install toolchain, again: sudo apt install g++-miltilib-arm-linux-gnueabi, and it solved configuration process.
But the topic (excepted compilation) is still yet:
=5 -DQT_VERSION_MINOR=12 -DQT_VERSION_PATCH=0 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/src/corelib/io/qfsfileengine.cpp In file included from /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/include/QtCore/qglobal.h:1:0, from /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/mkspecs/linux-g++/qplatformdefs.h:45, from /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/src/corelib/io/qfsfileengine_p.h:54, from /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/src/corelib/io/qfsfileengine.cpp:41: /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:121:49: error: static assertion failed: Unsupported: read/write return a type with different size as the len parameter # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^ /mnt/data/LinuxHome/Software/qt5/cache/qt-everywhere-src-5.12.0/qtbase/src/corelib/io/qfsfileengine.cpp:88:1: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ Q_STATIC_ASSERT_X(sizeof(SignedIOType) == sizeof(UnsignedIOType), ^ Makefile:439: recipe for target 'qfsfileengine.o' failed make: *** [qfsfileengine.o] Error 1
compiler:
$ arm-linux-gnueabi-g++ -v Using built-in specs. COLLECT_GCC=arm-linux-gnueabi-g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/5/lto-wrapper Target: arm-linux-gnueabi Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-armel-cross --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv5t --with-float=soft --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include Thread model: posix gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)
Qt configuration:
-opensource -confirm-license -device imx6 -device-option CROSS_COMPILE=arm-linux-gnueabi- -sysroot /home/eugene/Desktop/Qt5-imx.6/sysroot -prefix / -release -shared -no-opengl -no-cups -no-xcb -no-pch -skip qtactiveqt -skip qtconnectivity -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtsensors -skip qtsvg -skip qtdoc -nomake tools -nomake tests -nomake examples -v
I'm on Linux Mint 18.3 x64
-
It seems you are back to an older version of gcc. Do I see correctly ?
-
@SGaist Finally I got latest compiler:
wget https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabi/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi.tar.xz
and Qt config:
./configure \ -opensource \ -confirm-license \ -device imx6 \ -device-option CROSS_COMPILE=/home/eugene/Desktop/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi- \ -sysroot /home/eugene/Desktop/QtBuilder/sysroot \ -prefix / \ -no-gcc-sysroot \ -no-use-gold-linker \ -no-opengl \ -nomake tools \ -nomake tests \ -nomake examples \ -v
and excepted configuration process:
... Command line: -opensource -confirm-license -device imx6 -device-option CROSS_COMPILE=/home/eugene/Desktop/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi- -sysroot /home/eugene/Desktop/QtBuilder/sysroot -prefix / -no-gcc-sysroot -no-use-gold-linker -no-opengl -nomake tools -nomake tests -nomake examples -v Info: creating stash file /mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/.qmake.stash This is the Qt Open Source Edition. You have already accepted the terms of the Open Source license. Running configuration tests... Checking for machine tuple... + /home/eugene/Desktop/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ -dumpmachine > arm-linux-gnueabi test config.qtbase.tests.machineTuple succeeded Checking for valid makespec... + cd /mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/config.tests/verifyspec && /mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" /mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/qtbase/config.tests/verifyspec + cd /mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make > /home/eugene/Desktop/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard -O2 -w -fPIC -I/mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/qtbase/config.tests/verifyspec -I. -I/mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/qtbase/mkspecs/devices/linux-imx6-g++ -o verifyspec.o /mnt/data/LinuxHome/Software/QtBuilder/cache/qt-everywhere-opensource-src-5.9.7/qtbase/config.tests/verifyspec/verifyspec.cpp > /home/eugene/Desktop/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-g++ -mfloat-abi=hard -Wl,-O1 -o verifyspec verifyspec.o > /mnt/data/LinuxHome/Software/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.3.1/../../../../arm-linux-gnueabi/bin/ld: error: verifyspec.o uses VFP register arguments, verifyspec does not > /mnt/data/LinuxHome/Software/QtBuilder/cache/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabi/7.3.1/../../../../arm-linux-gnueabi/bin/ld: failed to merge target specific data of file verifyspec.o > collect2: error: ld returned 1 exit status > Makefile:66: recipe for target 'verifyspec' failed > make: *** [verifyspec] Error 1 Note: Also available for Linux: linux-clang linux-icc ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
-
@SGaist Seems that I have got a success with it. All manuals which I read (included nxp forum) told me about *-gnueabi compiler, but I tried to compile Qt for device imx6 with gcc-arm-8.2-2018.11-x86_64-arm-linux-gnueabihf (hard float). As result configuration and compilation was done without troubles.
-
Glad you succeeded and thanks for sharing !
Any chances that you had a sysroot that was mismatching with your compiler ?
-
@SGaist Well, I think no (if I understand your question right), because all paths to the compiler was setted right. Currently I'm trying to do a clean sysroot on my PC x86_64 (just a Qt+glib+gstreamer) with needed libraries (one question with pkg-config and Qt no resolved for me, yet) for the cross-compilation of target apps. As result I will produce a bash-script for a building an arm-sandbox to cross-compile from x86-64 machine to the ARM (specially imx6) and publish it here.
Also thank you for your leading questions (because really currently available in the Ubuntu repos version of compiler is deprecated, I think)!