Having already cross compiled the Boost development libraries from a Windows host to target Windows, Linux and Mac without problems, I’m feeling the Qt project does not support cross compiling from a Windows host, but instead cross compiling from a Linux host
But as I’m new to use the Qt project I ask here before going into bug report procedures If anyone attempted the same thing I do (which I admit are a bit experimental)
I have done multiple attempts targeting Linux but they always failed on Qt5 at the configuration tests stages, while in Qt4 I was able to hack stuffs to let the compilation starts, I’m having troubles to hack in Qt5 to do that, it seems many mkspecs .conf files includes other .conf files and it is a complete puzzle to deal with when cross compiling :(
My environment
Using cmd.exe to build Qt5
Carefully checking that sh is not found under any of my PATH env. vars
Using Qt5 git development repo on ‘stable’ branch (Revision: fb66951776e8decb8784c80fb7ed02864253065b Updated submodules. 28/03/2014 02:34:40)
Toolchains built with MSYS2 and crosstool-ng fork (diorcety)
My compilers
gcc-4.8.2-x86_64-w64-mingw32
gcc-4.8.2-i686-w64-mingw32
gcc-4.8.2-x86_64-unknown-linux-gnu
gcc-5666.3-x86_64-apple-darwin10
clang-3.4-x86_64-apple-darwin10
Successful cross compilations
Targets Windows 64-bit seh exception
SET PATH=X:/libs/compilers/gcc-4.8.2-x86_64-w64-mingw32/bin;X:/libs/msys64/mingw64/bin;%PATH%
configure -confirm-license -release -opensource -platform win32-g++ -opengl desktop -shared -no-angle -nomake examples -nomake tests -prefix x:/libs/qt-5_3_0/qt-win64-mgw48
Targets Windows 32-bit dwarf exception
SET PATH=X:/libs/compilers/gcc-4.8.2-i686-w64-mingw32/bin;X:/libs/msys64/mingw32/bin;%PATH%
configure -confirm-license -release -opensource -platform win32-g++ -opengl desktop -shared -no-angle -nomake examples -nomake tests -prefix x:/libs/qt-5_3_0/qt-win32-mgw48
Failing cross compilation
Targets Linux 64-bit
SET PATH=X:/libs/compilers/gcc-4.8.2-x86_64-w64-mingw32/bin;X:/libs/compilers/gcc-4.8.2-x86_64-unknown-linux-gnu/bin;X:/libs/msys64/mingw64/bin;%PATH%
configure -confirm-license -release -opensource -platform win32-g++ -xplatform linux-g++-64 -shared -no-angle -nomake examples -nomake tests -prefix X:/libs/qt-5_3_0/qt-linux64-gcc48 -device-option CROSS_COMPILE=x86_64-unknown-linux-gnu-
Results in: qmake is made properly for x86_64-w64-mingw32, but the tests fails because it uses Linux shell commands and some win32 gcc options are incompatible with linux gcc options
Running configuration tests...
arch.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
/****************************************************************************
^
process_begin: CreateProcess(NULL, rm -f arch.obj, ...) failed.
make (e=2): The system cannot find the file specified.
process_begin: CreateProcess(NULL, rm -f *~ core *.core, ...) failed.
make (e=2): The system cannot find the file specified.
process_begin: CreateProcess(NULL, rm -f arch, ...) failed.
make (e=2): The system cannot find the file specified.
process_begin: CreateProcess(NULL, rm -f Makefile, ...) failed.
make (e=2): The system cannot find the file specified.
x86_64-unknown-linux-gnu-g++: error: command line option '-fno-keep-inline-dllexport' is not supported by this configuration
x86_64-unknown-linux-gnu-g++: error: unrecognized command line option '-mthreads'
mingw32-make: *** [arch.o] Error 1
Could Not Find X:\libs\qt5\qtbase\config.tests\arch\arch.o
X:\libs\qt5>make
'test' is not recognized as an internal or external command,
operable program or batch file.
A subdirectory or file qtbase\ already exists.
Error occurred while processing: qtbase\.
Makefile:62: recipe for target 'module-qtbase-make_first' failed
make: *** [module-qtbase-make_first] Error 1
One regression I find from Qt4 to Qt5 changes is that in mkspecs/common/unix.conf is loaded include(shell-unix.conf) which will overwritte things set by the MINGW Makefile generator shell-win32.conf
include(shell-unix.conf)
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f
QMAKE_COPY_FILE = $$QMAKE_COPY
QMAKE_COPY_DIR = $$QMAKE_COPY -R
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_EXISTS = test -e %1 ||
QMAKE_CHK_DIR_EXISTS = test -d # legacy
QMAKE_MKDIR = mkdir -p # legacy
QMAKE_MKDIR_CMD = test -d %1 || mkdir -p %1
QMAKE_STREAM_EDITOR = sed
↧