Здравствуйте. Не получается собрать Qt 6.1.1 на x86_64 для aarch64. Собираю через cmake.
cmake_minimum_required(VERSION 3.16.3)
include_guard(GLOBAL)
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(TARGET_SYSROOT /home/kiruseni/qtForGlider/sysroot)
set(CROSS_COMPILER /usr/bin)
set(CMAKE_SYSROOT ${TARGET_SYSROOT})
set(ENV{PKG_CONFIG_PATH} "")
set(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_SYSROOT}/usr/lib/pkgconfig:${CMAKE_SYSROOT}/usr/share/pkgconfig)
set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT})
set(CMAKE_C_COMPILER ${CROSS_COMPILER}/aarch64-linux-gnu-gcc-10)
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER}/aarch64-linux-gnu-g++-10)
set(QT_COMPILER_FLAGS "-march=armv8-a")
set(QT_COMPILER_FLAGS_RELEASE "-O2 -pipe")
set(QT_LINKER_FLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed")
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)
include(CMakeInitializeConfigs)
function(cmake_initialize_per_config_variable _PREFIX _DOCSTRING)
if (_PREFIX MATCHES "CMAKE_(C|CXX|ASM)_FLAGS")
set(CMAKE_${CMAKE_MATCH_1}_FLAGS_INIT "${QT_COMPILER_FLAGS}")
foreach (config DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
if (DEFINED QT_COMPILER_FLAGS_${config})
set(CMAKE_${CMAKE_MATCH_1}_FLAGS_${config}_INIT "${QT_COMPILER_FLAGS_${config}}")
endif()
endforeach()
endif()
if (_PREFIX MATCHES "CMAKE_(SHARED|MODULE|EXE)_LINKER_FLAGS")
foreach (config SHARED MODULE EXE)
set(CMAKE_${config}_LINKER_FLAGS_INIT "${QT_LINKER_FLAGS}")
endforeach()
endif()
_cmake_initialize_per_config_variable(${ARGV})
endfunction()
Запускаю при помощи этой команды
cmake -DQT_HOST_PATH=/opt/Qt -DCMAKE_TOOLCHAIN_FILE=~/qtForGlider/toolchain.cmake -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON -DCMAKE_INSTALL_PREFIX=/usr/local/qt6 -DCMAKE_STAGING_PREFIX=/home/kiruseni/qtForGlider/build -DQT_BUILD_EXAMPLES=FALSE -DQT_BUILD_TESTS=FALSE -DCMAKE_BUILD_TYPE=Release /home/kiruseni/qtForGlider/qtgithub/qtbase-6.1.1/
cmake ругался на недостающий Qt6HostInfo.cmake (добавил ручками, скопировал из нативной компиляции) и ругался на qmake что такой цели нету, есть только qmake_native. Закомментил в CMakeList.txt в папке qmake все цели кроме UNIX. Теперь вот такую дичь выдает
Qt is now configured for building. Just run 'cmake --build . --parallel'
Once everything is built, Qt is installed. You should NOT run 'cmake --install .'
Note that this build cannot be deployed to other machines or devices.
To configure and build other Qt modules, you can use the following convenience script:
/home/kiruseni/qtForGlider/build/bin/qt-configure-module
If reconfiguration fails for some reason, try to remove 'CMakeCache.txt' from the build directory
-- Configuring incomplete, errors occurred!
See also "/home/kiruseni/qtForGlider/build/CMakeFiles/CMakeOutput.log".
See also "/home/kiruseni/qtForGlider/build/CMakeFiles/CMakeError.log".
в ерроре ругается на -lpthreads в основном