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

HostPrefix & HostData reference incorrect dir in target_qt.conf (when cross compiling)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Fixed
    • Affects Version/s: 6.3.2
    • Fix Version/s: 6.4.1
    • Component/s: Build System: CMake
    • Labels:
      None
    • Platform/s:
      Android

      Description

      There is a problem in the computation of the HostPrefix & HostData in target_qt.conf

      Source is unpacked in "/mnt/packages/git_repos/dpkg/qt6-base"

      1. Configure the host-build project this way

      cd /mnt/packages/git_repos/dpkg/qt6-base
      
      cd debian/build-host && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -GNinja -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DBUILD_WITH_PCH=OFF --log-level=STATUS -DCMAKE_LIBRARY_PATH=x86_64-linux-gnu -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_BINDIR=lib/qt6/bin -DINSTALL_LIBDIR=lib/x86_64-linux-gnu -DINSTALL_LIBEXECDIR=lib/qt6/libexec -DINSTALL_ARCHDATADIR=lib/x86_64-linux-gnu/qt6 -DINSTALL_EXAMPLESDIR=lib/x86_64-linux-gnu/qt6/examples -DINSTALL_DATADIR=share/qt6 -DINSTALL_HOSTDATADIR=lib/x86_64-linux-gnu/qt6 -DINSTALL_DOCDIR=share/qt6/doc -DINSTALL_SYSCONFDIR=/etc/xdg -DINSTALL_INCLUDEDIR=include/x86_64-linux-gnu/qt6 -DINSTALL_PLUGINDIR=lib/x86_64-linux-gnu/qt6/plugins -DINSTALL_TRANSLATIONDIR=share/qt6/translations -DINSTALL_MKSPECSDIR=lib/x86_64-linux-gnu/qt6/mkspecs -DINSTALL_PUBLICBINDIR=bin -DBUILD_EXAMPLES=ON -DFEATURE_mimetype_database=OFF -DFEATURE_dbus_linked=ON -DFEATURE_accessibility=ON -DFEATURE_doubleconversion=ON -DFEATURE_glib=ON -DFEATURE_icu=ON -DFEATURE_pcre2=ON -DFEATURE_system_pcre2=ON -DFEATURE_zlib=ON -DFEATURE_ssl=ON -DFEATURE_libproxy=ON -DFEATURE_system_proxies=ON -DFEATURE_cups=ON -DFEATURE_fontconfig=ON -DFEATURE_freetype=ON -DFEATURE_harfbuzz=ON -DFEATURE_gtk=ON -DFEATURE_directfb=OFF -DFEATURE_sql_odbc=ON -DFEATURE_sql_mysql=ON -DFEATURE_sql_psql=ON -DFEATURE_sql_sqlite=ON -DFEATURE_system_sqlite=ON -DFEATURE_jpeg=ON -DFEATURE_system_jpeg=ON -DFEATURE_png=ON -DFEATURE_system_png=ON -DFEATURE_system_libb2=ON -DFEATURE_rpath=OFF -DFEATURE_relocatable=OFF -DFEATURE_sql_ibase=ON -DFEATURE_sctp=ON ../..
      

      Notice that we use custom install directories.

      2. Configure the android-build project this way

      cd debian/build-armeabi-v7a && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -GNinja -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DBUILD_WITH_PCH=OFF -DQT_USE_CCACHE=ON -DCMAKE_INSTALL_PREFIX=/usr/lib/x86_64-linux-gnu/qt6-base-android-armeabi-v7a -DBUILD_WITH_PCH=OFF -DQT_QMAKE_TARGET_MKSPEC=android-clang -DANDROID_SDK_ROOT=/opt/android-sdk/ -DCMAKE_TOOLCHAIN_FILE=/opt/android-sdk/ndk/android-ndk-r23c/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DQT_HOST_PATH=/mnt/packages/git_repos/dpkg/qt6-base/debian/build-host -DQT_HOST_PATH_CMAKE_DIR=/mnt/packages/git_repos/dpkg/qt6-base/debian/build-host/lib/x86_64-linux-gnu/cmake -DCMAKE_BUILD_TYPE=Release -DFEATURE_sql_sqlite=OFF -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON ../..
      

      Notice that we use as QT_HOST_PATH the build dir of the host-build (and not the final installation dir)

      3. Build the host-build, then the android-build

      Content of target_qt.conf is (in the build dir, in the install dir as well) :

      HostPrefix=../../../../../mnt/packages/git_repos/dpkg/qt6-base/debian/build-host
      HostData=../../../../../../../usr/lib/x86_64-linux-gnu/qt6-base-android-armeabi-v7a
      

      Outcome:

      • HostPrefix might be correct if there wasn't use of custom install dirs in the config of the host build.
        If I run qmake (the one of the android-build) for example to build the sample android project 'androidnotifier', it will say that it doesn't find rcc in /mnt/packages/git_repos/dpkg/qt6-base/debian/build-host/libexec/rcc which is normal, since we used custom install dirs. It is actually in /mnt/packages/git_repos/dpkg/qt6-base/debian/build-host/lib/qt6/libexec/rcc
      • After installation, the content of the file is still unchanged = it contains the build dir.
        It would probably be better if it referenced the real final install dir of the host. Something like ../../../../../usr/lib/qt6
      • HostData, if it is supposed to reference a location of a directory of the host-build, it is incorrect too. Here it references the installation prefix of the android-build.

      BTW, the problem only reveals with qmake. Building androidnotifier with cmake in that configuration works.

        Attachments

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

          Activity

            People

            Assignee:
            jbornema Joerg Bornemann
            Reporter:
            ban F S
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes