I have already resolved the issue and successfully cross-compiled for arm64 on Ubuntu 24.04 x86 using Qt6.8.2.
I will provide my method.
The configure command is as follows:
../Src/configure \
-prefix /home/ptc/Qt/6.8.2/arm64 \
-qt-host-path /home/ptc/Qt/6.8.2/gcc_64 \
-platform linux-g++ \
-device linux-aarch64-gnu-g++ \
-device-option CROSS_COMPILE=aarch64-linux-gnu- \
-no-opengl \
-skip qtopcua -skip qtwebengine -skip qtwebview -skip qtserialport -skip qtlocation \
-no-feature-brotli -no-feature-hunspell \
-- -DCMAKE_TOOLCHAIN_FILE=$HOME/Qt/6.8.2/toolchain/arm64-toolchain.cmake
Before this, create a new toolchain.cmake file yourself.
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
set(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
set(CMAKE_LINKER "/usr/bin/aarch64-linux-gnu-ld")
set(CMAKE_AR "/usr/bin/aarch64-linux-gnu-ar")
set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
Next, you can follow my method to add the arm64-related dependencies on x86.
$ sudo dpkg --add-architecture arm64
$ sudo vim /etc/apt/sources.list.d/ubuntu-arm64.sources
Types: deb
URIs: http://ports.ubuntu.com/ubuntu-ports/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Architectures: arm64
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
$ sudo apt update
$ sudo apt install -y libudev-dev:arm64 libmtdev-dev:arm64
Finally, execute the configure command.