Platform linker doesn't support erroring upon encountering undefined symbols. Target:"Core".
Unsolved
General and Desktop
-
I am trying to cross compile Qt 6.5.0 for Raspberry Pi 0 W (armv6). I followed this wiki guide and changed it to use a armv6 cross compiler.
toolchain file: (
pi-0w-toolchain.cmake
)include_guard(GLOBAL) set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR arm) set(tools $ENV{HOME}/qt/toolchain/cross-pi-gcc-10.3.0-0/) # warning change toolchain path here. set(TARGET_SYSROOT $ENV{HOME}/rpi/sysroot/) set(rootfs_dir ${TARGET_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) set(ENV{PKG_CONFIG_PATH} $PKG_CONFIG_PATH:${TARGET_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig) set(ENV{PKG_CONFIG_LIBDIR} ${TARGET_SYSROOT}/usr/lib/pkgconfig:${TARGET_SYSROOT}/usr/share/pkgconfig/:${TARGET_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${TARGET_SYSROOT}/usr/lib/pkgconfig) set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) set(ENV{PKG_CONFIG_PATH} $PKG_CONFIG_PATH:/usr/lib/arm-linux-gnueabihf/pkgconfig) set(ENV{PKG_CONFIG_LIBDIR} /usr/lib/pkgconfig:/usr/share/pkgconfig/:${TARGET_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${TARGET_SYSROOT}/usr/lib/pkgconfig) set(ENV{PKG_CONFIG_SYSROOT_DIR} ${TARGET_SYSROOT}) # if you use other version of gcc and g++ than gcc/g++ 9, you must change the following variables SET(BIN_PREFIX ${tools}/bin/arm-linux-gnueabihf) SET (CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) SET (CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) SET (CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) SET (CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) SET (CMAKE_NM {BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) SET (CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) SET (CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) SET (CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) SET (CMAKE_STRIP {BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) # -fPIC # --unresolved-symbols=ignore-in-shared-libs set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}") set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_SYSROOT} -Wl,--unresolved-symbols=ignore-all -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -I${tools}/arm-linux-gnueabihf/include/c++/10.3.1 -L${tools}/arm-linux-gnueabihf/lib -L${tools}/lib/gcc/arm-linux-gnueabihf/10.3.1 -L/home/rnayabed/qt/toolchain/cross-pi-gcc-10.3.0-0/arm-linux-gnueabihf/libc/usr/lib") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_SYSROOT} -Wl,--unresolved-symbols=ignore-all -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -I${tools}/arm-linux-gnueabihf/include/c++/10.3.1 -L${tools}/arm-linux-gnueabihf/lib -L${tools}/lib/gcc/arm-linux-gnueabihf/10.3.1 -L/home/rnayabed/qt/toolchain/cross-pi-gcc-10.3.0-0/arm-linux-gnueabihf/libc/usr/lib") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${CMAKE_SYSROOT} -Wl,--unresolved-symbols=ignore-all -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}") set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_SYSROOT} -Wl,--unresolved-symbols=ignore-all -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -I${tools}/arm-linux-gnueabihf/include/c++/10.3.1 -L${tools}/arm-linux-gnueabihf/lib -L${tools}/lib/gcc/arm-linux-gnueabihf/10.3.1 -L/home/rnayabed/qt/toolchain/cross-pi-gcc-10.3.0-0/arm-linux-gnueabihf/libc/usr/lib") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${CMAKE_SYSROOT} -Wl,--unresolved-symbols=ignore-all -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -I${tools}/arm-linux-gnueabihf/include/c++/10.3.1 -L${tools}/arm-linux-gnueabihf/lib -L${tools}/lib/gcc/arm-linux-gnueabihf/10.3.1 -L/home/rnayabed/qt/toolchain/cross-pi-gcc-10.3.0-0/arm-linux-gnueabihf/libc/usr/lib") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${TARGET_SYSROOT}/usr/include") set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") #[[set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --sysroot=${CMAKE_SYSROOT} -I${TARGET_SYSROOT}/usr/include -I${TARGET_SYSROOT}/usr/include/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${CMAKE_SYSROOT} -I${TARGET_SYSROOT}/usr/include -I${TARGET_SYSROOT}/usr/include/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}") set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")]] set(QT_COMPILER_FLAGS "-march=armv6kz") 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) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_BUILD_RPATH ${TARGET_SYSROOT}) 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() set(XCB_PATH_VARIABLE ${TARGET_SYSROOT}) set(GL_INC_DIR ${TARGET_SYSROOT}/usr/include) set(GL_LIB_DIR ${TARGET_SYSROOT}:${TARGET_SYSROOT}/usr/lib/arm-linux-gnueabihf/:${TARGET_SYSROOT}/usr:${TARGET_SYSROOT}/usr/lib) set(EGL_INCLUDE_DIR ${GL_INC_DIR}) set(EGL_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libEGL.so) set(OPENGL_INCLUDE_DIR ${GL_INC_DIR}) set(OPENGL_opengl_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libOpenGL.so) set(GLESv2_INCLUDE_DIR ${GL_INC_DIR}) set(GLIB_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libGLESv2.so) set(GLESv2_INCLUDE_DIR ${GL_INC_DIR}) set(GLESv2_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libGLESv2.so) set(gbm_INCLUDE_DIR ${GL_INC_DIR}) set(gbm_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libgbm.so) set(Libdrm_INCLUDE_DIR ${GL_INC_DIR}) set(Libdrm_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libdrm.so) set(XCB_XCB_INCLUDE_DIR ${GL_INC_DIR}) set(XCB_XCB_LIBRARY ${XCB_PATH_VARIABLE}/usr/lib/arm-linux-gnueabihf/libxcb.so)
Output:
-- Performing Test HAVE_xcb_syslibs - Failed -- Performing Test HAVE_libinput_hires_wheel_support -- Performing Test HAVE_libinput_hires_wheel_support - Failed -- Performing Test HAVE_directwrite -- Performing Test HAVE_directwrite - Failed -- Performing Test HAVE_directwrite3 -- Performing Test HAVE_directwrite3 - Failed -- Performing Test HAVE_d2d1 -- Performing Test HAVE_d2d1 - Failed -- Performing Test HAVE_d2d1_1 -- Performing Test HAVE_d2d1_1 - Failed CMake Error at qtbase/cmake/QtBuildInformation.cmake:508 (message): Feature "opengl": Forcing to "ON" breaks its condition: QT_FEATURE_opengl_desktop OR QT_FEATURE_opengl_dynamic OR QT_FEATURE_opengles2 Condition values dump: QT_FEATURE_opengl_desktop = "OFF" QT_FEATURE_opengl_dynamic = "OFF" QT_FEATURE_opengles2 = "OFF" Call Stack (most recent call first): qtbase/cmake/QtFeature.cmake:288 (qt_configure_add_report_error) qtbase/cmake/QtFeature.cmake:410 (qt_feature_check_and_save_internal_value) qtbase/cmake/QtFeature.cmake:625 (qt_evaluate_feature) qtbase/cmake/QtFeature.cmake:594 (qt_feature_module_end) qtbase/src/CMakeLists.txt:13 (qt_feature_evaluate_features) -- Searching for tool 'Qt6::syncqt' in package Qt6CoreTools. -- Qt6::syncqt was found at /home/rnayabed/qt/host/./libexec/syncqt using package Qt6CoreTools. -- Tool 'Qt6::moc' was found at /home/rnayabed/qt/host/./libexec/moc. -- Tool 'Qt6::rcc' was found at /home/rnayabed/qt/host/./libexec/rcc. -- Tool 'Qt6::tracepointgen' was found at /home/rnayabed/qt/host/./libexec/tracepointgen. -- Tool 'Qt6::tracegen' was found at /home/rnayabed/qt/host/./libexec/tracegen. -- Tool 'Qt6::cmake_automoc_parser' was found at /home/rnayabed/qt/host/./libexec/cmake_automoc_parser. -- Looking for pthread.h -- Looking for pthread.h - not found -- Could NOT find Threads (missing: Threads_FOUND) -- Using system PCRE2. -- Found WrapPCRE2: TRUE -- Using system ZLIB. -- Found WrapZLIB: TRUE -- Could NOT find Backtrace (missing: Backtrace_LIBRARY) -- Could NOT find WrapSystemDoubleConversion (missing: DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR __double_conversion_found) -- Found GLIB2: /home/rnayabed/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libglib-2.0.so -- Found the following ICU libraries: -- i18n (required) -- uc (required) -- data (required) -- Checking for module 'libsystemd' -- Found libsystemd, version 247 -- Checking for module 'libb2' -- No package 'libb2' found -- Could NOT find WrapRt (missing: WrapRt_FOUND) -- Could NOT find Slog2 (missing: Slog2_INCLUDE_DIR Slog2_LIBRARY) -- Performing Test HAVE_DASH_UNDEFINED_SYMBOLS -- Performing Test HAVE_DASH_UNDEFINED_SYMBOLS - Failed -- Performing Test HAVE_DASH_DASH_NO_UNDEFINED -- Performing Test HAVE_DASH_DASH_NO_UNDEFINED - Failed CMake Error at qtbase/cmake/QtFlagHandlingHelpers.cmake:111 (message): Platform linker doesn't support erroring upon encountering undefined symbols. Target:"Core". Call Stack (most recent call first): qtbase/cmake/QtModuleHelpers.cmake:796 (qt_internal_add_link_flags_no_undefined) qtbase/src/corelib/CMakeLists.txt:40 (qt_internal_add_module) -- Configuring incomplete, errors occurred! See also "/home/rnayabed/qt/pi-0w-build/CMakeFiles/CMakeOutput.log". See also "/home/rnayabed/qt/pi-0w-build/CMakeFiles/CMakeError.log". CMake Error at /home/rnayabed/qt/source/qtbase/cmake/QtProcessConfigureArgs.cmake:994 (message): CMake exited with code 1.