Cross compile build fails with qgrayraster.c
-
Hi, I am cross compiling qt 6.4.2 using https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi as my rough guide.
I am using a tool chain from https://toolchains.bootlin.com/releases_aarch64.htmlAfter a lot of fiddling I ended up getting a successful config with the following config command:
../qtbase/configure -release -opengl es2 -nomake examples -nomake tests -qt-host-path $CROSSCOMPILE/qt6/qt-host2 -extprefix $CROSSCOMPILE/qt6/qt-raspi2 -prefix /usr/local/qt6 -device linux-rasp-pi4-aarch64 -device-option CROSS_COMPILE=aarch64-linux-gnu- -submodules qtwayland -- -DCMAKE_TOOLCHAIN_FILE=$CROSSCOMPILE/toolchain.cmake -DQT_FEATURE_kms=ON -DQT_FEATURE_opengles2=ON -DQT_FEATURE_opengles3=ON
but upon trying to build I get some errors, the first of which is:
Building C object src/gui/CMakeFiles/Gui.dir/painting/qgrayraster.c.o FAILED: src/gui/CMakeFiles/Gui.dir/painting/qgrayraster.c.o /home/tommy/projects/rPi4_OS/crossCompile/toolchain/aarch64--glibc--stable-2021.11-1/bin/aarch64-linux-gcc --sysroot=/home/tommy/projects/rPi4_OS/crossCompile/toolchain/aarch64--glibc--stable-2021.11-1/aarch64-buildroot-linux-gnu/sysroot -DGui_EXPORTS -DMD4C_USE_UTF8 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_GUI_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x070000 -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_EGL_NO_X11 -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_USING_NAMESPACE -DQT_QPA_DEFAULT_PLATFORM_NAME=\"xcb\" -DQT_USE_QSTRINGBUILDER -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/src/gui/Gui_autogen/include -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtGui -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/gui -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/src/gui -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/gui/../3rdparty/VulkanMemoryAllocator -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtGui/6.4.2 -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtGui/6.4.2/QtGui -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/gui/../3rdparty/md4c -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/gui/../3rdparty/zlib/src -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtCore -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/mkspecs/devices/linux-rasp-pi4-aarch64 -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/src/corelib -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtCore/6.4.2 -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtCore/6.4.2/QtCore -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/3rdparty/libpng -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/3rdparty/harfbuzz-ng/include/harfbuzz -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/3rdparty/freetype/include -I/home/tommy/projects/rPi4_OS/crossCompile/qt6/qtpi-build2/include/QtDBus -isystem /home/tommy/projects/rPi4_OS/crossCompile/rpi-sysroot/usr/include -I/home/tommy/projects/rPi4_OS/crossCompile/toolchain/aarch64--glibc--stable-2021.11-1/aarch64-buildroot-linux-gnu/sysroot/usr/include -pipe -DNDEBUG -O3 -std=c11 -fPIC -fvisibility=hidden -Wall -Wextra -fno-exceptions -MD -MT src/gui/CMakeFiles/Gui.dir/painting/qgrayraster.c.o -MF src/gui/CMakeFiles/Gui.dir/painting/qgrayraster.c.o.d -o src/gui/CMakeFiles/Gui.dir/painting/qgrayraster.c.o -c /home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/gui/painting/qgrayraster.c In file included from /home/tommy/projects/rPi4_OS/crossCompile/qt6/qtbase/src/gui/painting/qgrayraster.c:152: /home/tommy/projects/rPi4_OS/crossCompile/rpi-sysroot/usr/include/stdlib.h:606:35: error: expected ‘,’ or ‘;’ before ‘__attribute_alloc_align__’ 606 | __THROW __attribute_malloc__ __attribute_alloc_align__ ((1)) | ^~~~~~~~~~~~~~~~~~~~~~~~~
which being as its complaining about stdlib.h make me think there is a setting I must have fundamentally wrong but not sure where to start looking tbh. Any idea welcome. Thanks!
-
Please don't ask the same question in different threads.
I'm closing this one as duplicate of https://forum.qt.io/topic/161584/cross-compile-build-fails-with-qgrayraster-c
-
A aha_1980 locked this topic