Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87873

Qt 6 for Android CMake failing to build with QT_CHAINLOAD_TOOLCHAIN_FILE

    XMLWordPrintable

Details

    Description

      When using a local build for Qt for Android that was build using an NDK version 21.1.6352462 then trying to use that build to build a user project with a different NDK version 21.3.6528147, the configuration passes using the following args:

      ~/Qt/6.0.x/android/target_arm64_v8a/bin/qt-cmake --trace-expand --trace-redirect=cmake.trace -S .. -B . 
      -GNinja 
      -DANDROID_SDK_ROOT:PATH=/home/assam/Android/Sdk 
      -DQT_CHAINLOAD_TOOLCHAIN_FILE:PATH=/home/assam/Android/Sdk/ndk/21.3.6528147/build/cmake/android.toolchain.cmake
      

      Then when trying to build, there are lots of errors like

      [0/1] Re-running CMake...
      -- Found android platform plugin at: /home/assam/Qt/6.0.x/android/target_arm64_v8a/plugins/platforms/libplugins_platforms_qtforandroid_arm64-v8a.so
      message:
      VERSION
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /home/assam/qt_projects/addressbook-cmake/build
      [2/11] Building CXX object CMakeFiles/addressbook.dir/tablemodel.cpp.o
      FAILED: CMakeFiles/addressbook.dir/tablemodel.cpp.o 
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --gcc-toolchain=/home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Daddressbook_EXPORTS -I. -I../ -Iaddressbook_autogen/include -isystem /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore -isystem /home/assam/Qt/6.0.x/android/target_arm64_v8a/include -isystem /home/assam/Qt/6.0.x/android/target_arm64_v8a/mkspecs/android-clang -isystem /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtGui -isystem /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -isystem /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtWidgets -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fPIC -fvisibility=default -pthread -std=gnu++17 -MD -MT CMakeFiles/addressbook.dir/tablemodel.cpp.o -MF CMakeFiles/addressbook.dir/tablemodel.cpp.o.d -o CMakeFiles/addressbook.dir/tablemodel.cpp.o -c ../tablemodel.cpp
      In file included from ../tablemodel.cpp:51:
      In file included from ../tablemodel.h:54:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/QAbstractTableModel:1:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qabstractitemmodel.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhash.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhashfunctions.h:47:
      In file included from /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/numeric:148:
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace; did you mean 'sigwait'?
      using ::signbit;
            ~~^
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/signal.h:129:5: note: 'sigwait' declared here
      int sigwait(const sigset_t* __set, int* __signal);
          ^
      In file included from ../tablemodel.cpp:51:
      In file included from ../tablemodel.h:54:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/QAbstractTableModel:1:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qabstractitemmodel.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhash.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhashfunctions.h:47:
      In file included from /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/numeric:148:
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace; did you mean 'qFpClassify'?
      using ::fpclassify;
            ~~^
      /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qnumeric.h:50:41: note: 'qFpClassify' declared here
      Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int qFpClassify(double val);
                                              ^
      In file included from ../tablemodel.cpp:51:
      In file included from ../tablemodel.h:54:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/QAbstractTableModel:1:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qabstractitemmodel.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhash.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhashfunctions.h:47:
      In file included from /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/numeric:148:
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
      using ::isfinite;
            ~~^
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/math.h:375:5: note: 'finite' declared here
      int finite(double __x) __attribute_const__;
          ^
      In file included from ../tablemodel.cpp:51:
      In file included from ../tablemodel.h:54:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/QAbstractTableModel:1:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qabstractitemmodel.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhash.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhashfunctions.h:47:
      In file included from /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/numeric:148:
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace
      using ::isnormal;
            ~~^
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/cmath:323:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
      using ::isgreater;
            ^~
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/functional:738:29: note: '::std::greater' declared here
      struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                                  ^
      In file included from ../tablemodel.cpp:51:
      In file included from ../tablemodel.h:54:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/QAbstractTableModel:1:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qabstractitemmodel.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhash.h:44:
      In file included from /home/assam/Qt/6.0.x/android/target_arm64_v8a/include/QtCore/qhashfunctions.h:47:
      In file included from /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/numeric:148:
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/cmath:324:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
      using ::isgreaterequal;
            ^~
      /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/functional:767:29: note: '::std::greater_equal' declared here
      struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
      

      It seems that the configuration is looking inside both NDK paths, the one used to build Qt, and the one provided to build the user project.

      CMake trace file is attached

       

      If the old ndk folder is removed/doesn't exist, the configure throws these messages (seems harmful) and the build works fine

      -- Detecting CXX compiler ABI info
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Looking for C++ include pthread.h
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
      -- Looking for C++ include pthread.h - found
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      -- Check if compiler accepts -pthread
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
      -- Check if compiler accepts -pthread - yes
      -- Found Threads: TRUE  
      -- Performing Test HAVE_STDATOMIC
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
      -- Performing Test HAVE_STDATOMIC - Success
      -- Found WrapAtomic: TRUE  
      -- Performing Test HAVE_EGL
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
      -- Performing Test HAVE_EGL - Success
      -- Found EGL: /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include (found version "1.5") 
      -- Performing Test HAVE_GLESv2
      CMake Warning at /home/assam/Qt/6.0.x/android/target_arm64_v8a/lib/cmake/Qt6/qt.toolchain.cmake:44 (message):
        The toolchain file to be chainloaded
        '/home/assam/Android/Sdk/ndk/21.1.6352462/build/cmake/android.toolchain.cmake'
        does not exist.
      Call Stack (most recent call first):
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/3.18.3/CMakeSystem.cmake:6 (include)
        /home/assam/qt_projects/addressbook-cmake/build/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
      -- Performing Test HAVE_GLESv2 - Success
      -- Found GLESv2: /home/assam/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include  
      -- Found android platform plugin at: /home/assam/Qt/6.0.x/android/target_arm64_v8a/plugins/platforms/libplugins_platforms_qtforandroid_arm64-v8a.so
      message:
      VERSION
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /home/assam/qt_projects/addressbook-cmake/build
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            assam Assam Boudjelthia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes