Qt 6.8.3 build fails for arm64 when compiled using gcc cross compiler x86_64-aarch64 toolchain.
-
I have,
Host OS: RockyLinux8.10(x86_64)
cross compiler toolchain: gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu
sysroot used from a docker container for required arm64 packages: FROM --platform=linux/arm64 arm64v8/debian:12
I was able to build Qt6.8.3 for x86_64 on the RockyLinux8.10 with gcc-toolset-12(gcc 12.2.1)In src/qtbase/src/corelib/io/qstorageinfo_linux.cpp
static inline quint64 mountIdForPath(int fd)
{
if (fd < 0)
return 0;
#if defined(STATX_BASIC_STATS) && defined(STATX_MNT_ID)
// STATX_MNT_ID was added in kernel v5.8
struct statx st;
int r = statx(fd, "", AT_EMPTY_PATH | AT_NO_AUTOMOUNT, STATX_MNT_ID, &st);
if (r == 0 && (st.stx_mask & STATX_MNT_ID))
return st.stx_mnt_id;
#endif
return 0;
}Error:
FAILED: qtbase/src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o
/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++ --sysroot=/home/user1/workspace1/Vendor/sysroot//aarch64/DEBIAN12 -DBACKTRACE_HEADER="execinfo.h" -DCore_EXPORTS -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_MOC_COMPAT -DQT_NO_CAST_TO_ASCII -DQT_NO_CONTEXTLESS_CONNECT -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QASCONST -DQT_NO_QEXCHANGE -DQT_NO_QPAIR -DQT_NO_QSNPRINTF -DQT_NO_USING_NAMESPACE -DQT_TYPESAFE_FLAGS -DQT_USE_NODISCARD_FILE_OPEN -DQT_USE_QSTRINGBUILDER -DQT_ZLIB_LIB -D_GLIBCXX_ASSERTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/corelib/Core_autogen/include -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/include -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/include/QtCore -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/corelib -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/corelib/global -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/corelib/kernel -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/../3rdparty/tinycbor/src -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/include/QtCore/6.8.3 -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/include/QtCore/6.8.3/QtCore -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/../3rdparty/double-conversion -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/../3rdparty/forkfd -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/corelib/.rcc -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/mkspecs/linux-g++ -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/include/QtZlib -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/3rdparty/zlib -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/3rdparty/zlib -I/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/3rdparty/pcre2/src -isystem /home/user1/workspace1/Vendor/ICU/60/aarch64/out/include -isystem /home/user1/workspace1/Vendor/sysroot/aarch64/DEBIAN12/usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -DNDEBUG -O3 -std=gnu++17 -fPIC -Wall -Wextra -fexceptions -U_FORTIFY_SOURCE -Wsuggest-override -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fstack-clash-protection -Winvalid-pch -include /home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/tmp/qtbase/src/corelib/CMakeFiles/Core.dir/cmake_pch.hxx -MD -MT qtbase/src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o -MF qtbase/src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o.d -o qtbase/src/corelib/CMakeFiles/Core.dir/io/qstorageinfo_linux.cpp.o -c /home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/io/qstorageinfo_linux.cpp
/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/io/qstorageinfo_linux.cpp: In function ‘quint64 mountIdForPath(int)’:
/home/user1/workspace1/Vendor/Qt/6.8.3/aarch64/src/qtbase/src/corelib/io/qstorageinfo_linux.cpp:111:19: error: ‘struct statx’ has no member named ‘stx_mnt_id’; did you mean ‘stx_uid’?
111 | return st.stx_mnt_id;
| ^~~~~~~~~~
| stx_uid
[418/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/io/qprocess.cpp.o
[419/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/itemmodels/qabstractproxymodel.cpp.o
[420/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/itemmodels/qidentityproxymodel.cpp.o
[421/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/itemmodels/qconcatenatetablesproxymodel.cpp.o
[422/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/itemmodels/qitemselectionmodel.cpp.o
[423/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/io/qsettings.cpp.o
[424/11610] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/itemmodels/qabstractitemmodel.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile.Linux:236: libs] Error 1
qt-aarch64:x86_64: error executing command, status: 2qt-aarch64:x86_64: command failed: 2
Operation aborted.In gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu, ./gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/libc/usr/include/bits/statx-generic.h:43:# define STATX_MNT_ID 0x1000U macro defined. But in ./gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/libc/usr/include/linux/stat.h struct statx does has stx_mnt_id(Mismatch in headers.)
In docker rootfs which I am providing as --sysroot while compilation, /usr/include/linux/stat.h "struct statx" has stx_mnt_id variable and /usr/include/bits/statx-generic.h define any STATX_MNT_ID macro. Both are there.
Please let me know how to fix this issue, i tried downgrading the cross compiler to gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu which doesn't define STATX_MNT_ID, but still same issue is seen.
Thanks
-
Looks like the feature STATX_MNT_ID was detected even your system does not support it. I would simply ifdef it out so the function returns 0
-
Looks like the feature STATX_MNT_ID was detected even your system does not support it. I would simply ifdef it out so the function returns 0
@Christian-Ehrlicher I am now building Qt inside a podman container running on arm64 arch using qemu emulator on top of x86_64 host.
I was able to build Qt 6.8.3 without QtWebengine and QtPdf. When I enabled this two components of Qt, my build is failing with "Too many open files" error in the middle of the build. How to resolve this. I tried reducing job count to 1, still I am seeing this issue. -
-
Looks like the feature STATX_MNT_ID was detected even your system does not support it. I would simply ifdef it out so the function returns 0
Thanks for the reply @Christian-Ehrlicher ,
may be dump question , can we install the installer that you have shared for arm64 installer(https://download.qt.io/official_releases/online_installers/) on the podman container directly ?on top of that can we customize the other lib like openssl,icu versions is it possible ?
-