Issue with building Qt 5.15.16 for UWP arm
-
Hello!
I want to build
Qt 5.15.16
forUWP arm
architecture. I use"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsx86_arm.bat"
command prompt and get the following error:fatal error C1189: #error: "Unable to determine byte order!"
** Visual Studio 2019 Developer Command Prompt v16.11.42 ** Copyright (c) 2021 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x86_arm' C:\QtBuild\qt-everywhere-src-5.15.16>configure.bat -top-level -debug-and-release -xplatform "winrt-arm-msvc2019" -confirm-license -mp -c++std c++17 -opensource -nomake examples -no-ltcg -skip qtwebengine -prefix "C:\Qt\5.15.16\winrt_armv7_msvc2019" + cd qtbase + C:\QtBuild\qt-everywhere-src-5.15.16\qtbase\configure.bat -top-level -top-level -debug-and-release -xplatform "winrt-arm-msvc2019" -confirm-license -mp -c++std c++17 -opensource -nomake examples -no-ltcg -skip qtwebengine -prefix "C:\Qt\5.15.16\winrt_armv7_msvc2019" Bootstrapping qmake ... jom 1.1.4 - empower your cores cl -c -Fo./ -Fdqmake.pdb -W2 -nologo -O2 /MP /wd4577 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\library -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\unix -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\win32 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\mac -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/src/3rdparty/tinycbor/src -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore\5.15.16 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore\5.15.16\QtCore -I..\src\corelib\global -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\mkspecs\win32-msvc -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DQT_VERSION_STR=\"5.15.16\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=15 -DQT_VERSION_PATCH=16 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH -DUNICODE -D_ENABLE_EXTENDED_ALIGNED_STORAGE -c -Yc -Fpqmake_pch.pch -TP C:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\qmake_pch.h qmake_pch.h C:\QtBuild\qt-everywhere-src-5.15.16\qtbase\include\QtCore\../../src/corelib/global/qprocessordetection.h(364): fatal error C1189: #error: "Unable to determine byte order!" jom: C:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\Makefile [qmake_pch.obj] Error 2 C:\QtBuild\qt-everywhere-src-5.15.16>
According to the file: qprocessordetection.h
/* NOTE: GCC 4.6 added __BYTE_ORDER__, __ORDER_BIG_ENDIAN__, __ORDER_LITTLE_ENDIAN__ and __ORDER_PDP_ENDIAN__ in SVN r165881. If you are using GCC 4.6 or newer, this code will properly detect your target byte order; if you are not, and the __LITTLE_ENDIAN__ or __BIG_ENDIAN__ macros are not defined, then this code will fail to detect the target byte order. */ // Some processors support either endian format, try to detect which we are using. #if !defined(Q_BYTE_ORDER) # if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == Q_BIG_ENDIAN || __BYTE_ORDER__ == Q_LITTLE_ENDIAN) // Reuse __BYTE_ORDER__ as-is, since our Q_*_ENDIAN #defines match the preprocessor defaults # define Q_BYTE_ORDER __BYTE_ORDER__ # elif defined(__BIG_ENDIAN__) || defined(_big_endian__) || defined(_BIG_ENDIAN) # define Q_BYTE_ORDER Q_BIG_ENDIAN # elif defined(__LITTLE_ENDIAN__) || defined(_little_endian__) || defined(_LITTLE_ENDIAN) \ || defined(WINAPI_FAMILY) // WinRT is always little-endian according to MSDN. # define Q_BYTE_ORDER Q_LITTLE_ENDIAN # else # error "Unable to determine byte order!" # endif #endif
The issue is that it can not detect the
Q_BYTE_ORDER
when usingvcvarsx86_arm.bat
for crossplatform compilation.
Any ideas how to fix this issue? Thanks. -
According to this documentation: https://wiki.qt.io/WinRTBuild
From docs:
No matter what your target (PC, Surface, Phone, etc.), ALWAYS USE the "x86 Native tools command prompt". This is because the command prompt will first build host tools (qmake, moc, rcc, etc.) and then cross-compile the Qt libraries. Do not open the Windows Phone command prompt, for instance, as it will not be able to build the host tools.So, I tried the
x86 Native Tools Command Prompt for VS 2019
to build:winrt-arm-msvc2019
... cl -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch -c -Fo./ -Fdqmake.pdb -W2 -nologo -O2 /MP /wd4577 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\library -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\unix -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\win32 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\mac -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/src/3rdparty/tinycbor/src -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore\5.15.16 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore\5.15.16\QtCore -I..\src\corelib\global -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\mkspecs\win32-msvc -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DQT_VERSION_STR=\"5.15.16\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=15 -DQT_VERSION_PATCH=16 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH -DUNICODE -D_ENABLE_EXTENDED_ALIGNED_STORAGE C:\QtBuild\qt-everywhere-src-5.15.16\qtbase\src\corelib\serialization\qjsonvalue.cpp qjsonvalue.cpp cl -c -Fo./ -Fdqmake.pdb -W2 -nologo -O2 /MP /wd4577 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\library -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\unix -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\win32 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\qmake\generators\mac -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/src/3rdparty/tinycbor/src -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore\5.15.16 -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase/include\QtCore\5.15.16\QtCore -I..\src\corelib\global -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\mkspecs\win32-msvc -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DQT_VERSION_STR=\"5.15.16\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=15 -DQT_VERSION_PATCH=16 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH -DUNICODE -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_BUILD_QMAKE_BOOTSTRAP C:\QtBuild\qt-everywhere-src-5.15.16\qtbase\src\corelib\global\qlibraryinfo.cpp qlibraryinfo.cpp link /OUT:..\bin\qmake.exe project.obj main.obj ioutils.obj proitems.obj qmakevfs.obj qmakeglobals.obj qmakeparser.obj qmakeevaluator.obj qmakebuiltins.obj makefile.obj unixmake.obj unixmake2.obj mingw_make.obj option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj makefiledeps.obj metamakefile.obj xmloutput.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj msvc_objectmodel.obj msbuild_objectmodel.obj registry.obj qbitarray.obj qbuffer.obj qcryptographichash.obj qfilesystementry.obj qfilesystemengine.obj qfilesystemengine_win.obj qfilesystemiterator_win.obj qfsfileengine.obj qfsfileengine_iterator.obj qarraydata.obj qbytearray.obj qbytearraylist.obj qvsnprintf.obj qbytearraymatcher.obj qcalendar.obj qdatetime.obj qdir.obj qdiriterator.obj qfiledevice.obj qfile.obj qtemporaryfile.obj qabstractfileengine.obj qfsfileengine_win.obj qsystemlibrary.obj qfileinfo.obj qendian.obj qglobal.obj qgregoriancalendar.obj qhash.obj qiodevice.obj qringbuffer.obj qdebug.obj qlist.obj qlocale.obj qlocale_tools.obj qlocale_win.obj qversionnumber.obj qmalloc.obj qmap.obj qoperatingsystemversion.obj qoperatingsystemversion_win.obj qregexp.obj qromancalendar.obj qutfcodec.obj qstring.obj qstringlist.obj qstringbuilder.obj qsystemerror.obj qtextstream.obj qdatastream.obj quuid.obj qrandom.obj qsettings.obj qvariant.obj qsettings_win.obj qmetatype.obj qxmlstream.obj qxmlutils.obj qnumeric.obj qlogging.obj qcborstreamwriter.obj qcborvalue.obj qjsoncbor.obj qjsondocument.obj qjsonparser.obj qjsonarray.obj qjsonobject.obj qjsonvalue.obj qlibraryinfo.obj qmake_pch.obj ole32.lib advapi32.lib shell32.lib netapi32.lib Microsoft (R) Incremental Linker Version 14.29.30157.0 Copyright (C) Microsoft Corporation. All rights reserved. Info: creating super cache file C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\.qmake.super Info: creating cache file C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\.qmake.cache Info: creating stash file C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\.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 valid makespec... ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken. Check config.log for details. C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild>
In the config.log:
Command line: -debug-and-release -xplatform winrt-arm-msvc2019 -confirm-license -mp -c++std c++17 -opensource -nomake examples -no-ltcg -skip qtwebengine -prefix C:\Qt\5.15.16\winrt_armv7_msvc2019 executing config test verifyspec + cd /d C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\config.tests\verifyspec && C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\qtbase\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LFLAGS += /ENTRY:main" -early "CONFIG += cross_compile" C:/QtBuild/qt-everywhere-src-5.15.16/qtbase/config.tests/verifyspec + cd /d C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\config.tests\verifyspec && set MAKEFLAGS=& jom > jom 1.1.4 - empower your cores > cl -c -nologo -FS -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -GR -EHsc -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQ_BYTE_ORDER=Q_LITTLE_ENDIAN -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -DWINAPI_PARTITION_PHONE_APP=1 -DARM -D__ARM__ -D__arm__ -DNDEBUG -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\config.tests\verifyspec -I. -IC:\QtBuild\qt-everywhere-src-5.15.16\qtbase\mkspecs\winrt-arm-msvc2019 -Fo @C:\Users\cobra\AppData\Local\Temp\verifyspec.obj.34368.0.jom > verifyspec.cpp > link /NOLOGO /DYNAMICBASE /NXCOMPAT /NODEFAULTLIB:ole32.lib /APPCONTAINER /MACHINE:ARM /NODEFAULTLIB:kernel32.lib /ENTRY:main /INCREMENTAL:NO /SUBSYSTEM:WINDOWS /MANIFEST:NO /OUT:verifyspec.exe @C:\Users\cobra\AppData\Local\Temp\verifyspec.exe.34368.31.jom > verifyspec.obj : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'ARM' > jom: C:\QtBuild\qt-everywhere-src-5.15.16\qtBuild\config.tests\verifyspec\Makefile [verifyspec.exe] Error 1112
So, I get another issue. Is there a way to skip test verifyspec?