Qt Cross Compile - some binaries are not cross compiled
-
Hello, I have a problem with cross compilation. I have some older release of QT (5.5.1) which I'm trying to cross compile. Here is the command which I use for configure:
/home/lord/Development/SMON3/smon-base/build/qt/qtbase/configure -no-opengl -no-gui -no-xinput2 -no-xinput2 -no-glib -no-pulseaudio -no-alsa -no-gtkstyle -no-widgets -no-tslib -no-nis -no-cups -no-iconv -no-evdev -no-icu -no-xcb -no-eglf s -no-kms -no-directfb -no-linuxfb -no-libinput -no-gstreamer -system-proxies -device linux-cubieboard2-g++ -device-option CROSS_COMPILE=/home/lord/Development/SMON3/smon-base/compilator/bin/arm-linux-gnueabihf- -sysroot /home/lord/Devel opment/SMON3/smon-base/stage/filesystem -opensource -confirm-license -optimized-qmake -release -make libs -prefix /opt/qt-cubieboard2 -no-pch -nomake examples -nomake tests -no-xcb -skip webkit -skip qtquick1 "$@"
I specified there CROSS_COMPILATOR and --sysroot. After a few minutes it finish without errors with following info in config.summary
Configure summary Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: devices/linux-cubieboard2-g++ (arm, CPU features: neon) Platform notes: - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx qmake vars .......... styles += mac fusion windows DEFINES += QT_NO_MTDEV DEFINES += QT_NO_LIBUDEV DEFINES += QT_NO_EVDEV DEFINES += QT_NO_TSLIB DEFINES += QT_NO_LIBINPUT sql-drivers = sql-plugins = sqlite qmake switches .........
Up to now I think that everything is OK, I'm building on x86_64 architecture for ARM architecture.
Make && make install finish also OK, it creates a lot of libraries and some binaries. Then I check binaries in target location (/opt/qt-cubieboard2/bin) and some of them are not compiled for ARM architecture.
file * lconvert: ELF 64-bit LSB executable, x86-64, version lrelease: ELF 64-bit LSB executable, x86-64, version lupdate: ELF 64-bit LSB executable, x86-64, version moc: ELF 64-bit LSB executable, x86-64, version qdbus: ELF 32-bit LSB executable, ARM, EABI5 version qdbuscpp2xml: ELF 64-bit LSB executable, x86-64, version qdbusxml2cpp: ELF 64-bit LSB executable, x86-64, version qdoc: ELF 64-bit LSB executable, x86-64, version qlalr: ELF 64-bit LSB executable, x86-64, version qmake: ELF 64-bit LSB executable, x86-64, version qml: ELF 32-bit LSB executable, ARM, EABI5 version qmlimportscanner: ELF 64-bit LSB executable, x86-64, version qmllint: ELF 64-bit LSB executable, x86-64, version qmlmin: ELF 64-bit LSB executable, x86-64, version qtpaths: ELF 32-bit LSB executable, ARM, EABI5 version qtplugininfo: ELF 32-bit LSB executable, ARM, EABI5 version rcc: ELF 64-bit LSB executable, x86-64, version syncqt.pl: Perl script, ASCII text executable xmlpatterns: ELF 32-bit LSB executable, ARM, EABI5 version xmlpatternsvalidator: ELF 32-bit LSB executable, ARM, EABI5 version
Main problem which I can see there is that qmake is not compiled for ARM. I need qmake to compile some Qt project for ARM. Am I doing something wrong ?
-
AFAIK when cross compiling Qt only the libraries and runtime tools are compiled and linked for the target so you can run Qt applications on the target. The builidng tools (e.g.
qmake
) are compiled for the host system so you have to cross compile your Qt apllications, too.
To getqmake
running on the target you have to compile Qt on the target (which may take several hours or days, depending on the target...). -
@micland Yes, you are right. I was somehow lost. I needed to have qmake compiled for x86_64, but what confused me was that this binary was mixed together with other (ARM) binaries.
Just to know. After config stage, it is possible to change CC variable in Makefile and get cross compiled qmake in a few minutes. Thank you and Regards !