Unsolved template parameter is an integral of a size not supported on this platform | Q_STATIC_ASSERT_X | aarch64
-
I'm cross compiling Qt for Debian aarch64.
I installed the compilers using
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
aarch64-linux-gnu-g++ version is
9.3.0
when I run make I encounter this error:
/home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:121:63: error: static assertion failed: template parameter is an integral of a size not supported on this platform 121 | # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) | ^~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ 97 | Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); | ^~~~~~~~~~~~~~~~~ make[3]: *** [Makefile:23936: .obj/qatomic.o] Error 1
I've tried
-std=c++2a
but the error persists.this is my qmake.conf file:
include(../common/linux_device_pre.conf) QMAKE_LIBS_EGL += -lEGL QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a72 QMAKE_CXXFLAGS = $$QMAKE_CFLAGS DISTRO_OPTS += aarch64 deb-aarch64 EGLFS_DEVICE_INTEGRATION = eglfs_kms include(../common/linux_device_post.conf) load(qt_config)
complete error log:
/home/ali/Qt/5.15.2/Src/qtbase/src/corelib/thread/qatomic.cpp:1747:4: error: #error "Q_ATOMIC_INT64_IS_SUPPORTED must be defined on a 64-bit platform" 1747 | # error "Q_ATOMIC_INT64_IS_SUPPORTED must be defined on a 64-bit platform" | ^~~~~ In file included from /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/qglobal.h:1, from /home/ali/Qt/5.15.2/Src/qtbase/src/corelib/global/qt_pch.h:56: /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h: In instantiation of ‘class QBasicAtomicInteger<long int>’: /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qatomic.h:59:7: required from ‘class QAtomicInteger<long int>’ /home/ali/Qt/5.15.2/Src/qtbase/src/corelib/thread/qatomic.cpp:1754:1: required from here /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:121:63: error: static assertion failed: template parameter is an integral of a size not supported on this platform 121 | define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) | ^~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ 97 | Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); | ^~~~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h: In instantiation of ‘class QBasicAtomicInteger<long unsigned int>’: /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qatomic.h:59:7: required from ‘class QAtomicInteger<long unsigned int>’ /home/ali/Qt/5.15.2/Src/qtbase/src/corelib/thread/qatomic.cpp:1755:1: required from here /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:121:63: error: static assertion failed: template parameter is an integral of a size not supported on this platform 121 | define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) | ^~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ 97 | Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); | ^~~~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h: In instantiation of ‘class QBasicAtomicInteger<long long unsigned int>’: /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qatomic.h:59:7: required from ‘class QAtomicInteger<long long unsigned int>’ /home/ali/Qt/5.15.2/Src/qtbase/src/corelib/thread/qatomic.cpp:1756:1: required from here /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:121:63: error: static assertion failed: template parameter is an integral of a size not supported on this platform 121 | define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) | ^~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ 97 | Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); | ^~~~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h: In instantiation of ‘class QBasicAtomicInteger<long long int>’: /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qatomic.h:59:7: required from ‘class QAtomicInteger<long long int>’ /home/ali/Qt/5.15.2/Src/qtbase/src/corelib/thread/qatomic.cpp:1757:1: required from here /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:121:63: error: static assertion failed: template parameter is an integral of a size not supported on this platform 121 | define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) | ^~~~~~~~~~~~~~~ /home/ali/Qt/5.15.2/Src/qtbase/include/QtCore/../../src/corelib/thread/qbasicatomic.h:97:5: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ 97 | Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported, "template parameter is an integral of a size not supported on this platform"); | ^~~~~~~~~~~~~~~~~ make[3]: *** [Makefile:23936: .obj/qatomic.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory '/home/ali/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/build/qtbase/src/corelib' make[2]: *** [Makefile:198: sub-corelib-make_first] Error 2 make[2]: *** Waiting for unfinished jobs.... g++ -Wl,-O1 -Wl,--gc-sections -o ../../../bin/qdbuscpp2xml .obj/moc.o .obj/preprocessor.o .obj/generator.o .obj/parser.o .obj/token.o .obj/collectjson.o .obj/qdbuscpp2xml.o /home/ali/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/build/qtbase/lib/libQt5BootstrapDBus.a /home/ali/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/build/qtbase/lib/libQt5Bootstrap.a -lpthread make[3]: Leaving directory '/home/ali/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/build/qtbase/src/tools/qdbuscpp2xml' make[2]: Leaving directory '/home/ali/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/build/qtbase/src' make[1]: *** [Makefile:51: sub-src-make_first] Error 2 make[1]: Leaving directory '/home/ali/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/build/qtbase' make: *** [Makefile:86: module-qtbase-make_first] Error 2
-
this is the first line of the error log:
#error "Q_ATOMIC_INT64_IS_SUPPORTED must be defined on a 64-bit platform"
there must be a config to tell the Qt that its aarch64, right?
-
Hi and welcome to devnet,
Can you share the configure command you use ?
-
@SGaist
Hi Thank you!~/Qt/5.15.2/Src/configure -release -opengl es2 -eglfs \ -device rpi4-64 -device-option CROSS_COMPILE=/usr/bin/aarch64-linux-gnu- \ -sysroot ~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot \ -prefix /usr/local/qt5.15.2 -extprefix ~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/qt5.15.2 \ -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker -v -recheck \ -L~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/lib/aarch64-linux-gnu \ -I~/Documents/Qt-CrossCompile-RaspberryPi/raspberrypi4/sysroot/usr/include/aarch64-linux-gnu
-
Why not use the linux-rasp-pi4-v3d mkspec ?
-
because that's not for aarch64 target