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

Building repos / tests outside of qtbase fails when using the boot2qt sdk

    XMLWordPrintable

Details

    Description

      If you try to build standalone tests of qtbase, or just qtsvg targeting armv7 using the boot2qt 2.7.2 SDK, it fails at cmake configure time with the following error:

      ../qtbase_built_developer_armv7/bin/qt-cmake-private ../qtsvg
      -- The CXX compiler identification is GNU 8.3.0
      -- The C compiler identification is GNU 8.3.0
      -- Check for working CXX compiler: /opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
      -- Check for working CXX compiler: /opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ - broken
      CMake Error at /home/alex/Dev/cmakes/src/Modules/CMakeTestCXXCompiler.cmake:53 (message):
        The C++ compiler
      
          "/opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++"
      
        is not able to compile a simple test program.
      
        It fails with the following output:
      
          Change Dir: /home/alex/Dev/qt/qt5_cmake/qtsvg_built_developer_armv7/CMakeFiles/CMakeTmp
      
          Run Build Command(s):/opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/bin/ninja cmTC_a2ec2 && [1/2] Building CXX object CMakeFiles/cmTC_a2ec2.dir/testCXXCompiler.cxx.o
          [2/2] Linking CXX executable cmTC_a2ec2
          FAILED: cmTC_a2ec2
          : && /opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ --sysroot=/opt/b2qt/2.7.2/sysroots/armv7at2hf-neon-poky-linux-gnueabi -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed CMakeFiles/cmTC_a2ec2.dir/testCXXCompiler.cxx.o -o cmTC_a2ec2   && :
          /opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/ld: error: cmTC_a2ec2 uses VFP register arguments, CMakeFiles/cmTC_a2ec2.dir/testCXXCompiler.cxx.o does not
          /opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/8.3.0/ld: failed to merge target specific data of file CMakeFiles/cmTC_a2ec2.dir/testCXXCompiler.cxx.o
          collect2: error: ld returned 1 exit status
          ninja: build stopped: subcommand failed.
      
        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:5 (project)
      

      The issue is that the boot2qt sdk cmake toolchain file has the piece of code:

      $ cat /opt/b2qt/2.7.2/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake
      # ....
      # Include the toolchain configuration subscripts
      file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
      foreach(config ${toolchain_config_files})
          include(${config})
      endforeach()
      

      It wants to load additional files (like qemuarmv7.cmake) which sets various compile and link flags.

      This fails for us because CMAKE_TOOLCHAIN_FILE is not the path for "OEToolchainConfig.cmake" but rather the qt toolchain that we generate which chain loads "OEToolchainConfig.cmake".

      CMAKE_TOOLCHAIN_FILE thus evaluates to "qt.toolchain.cmake" and none of the sdk specific files like qemuarmv7.cmake are loaded, causing a failure to compile even a simple cmake app.

      The proper way would be to fix the code to use CMAKE_CURRENT_LIST_FILE instead, push that upstream, create a new boot2qt sdk, provision it in our VMs, and use that.
      Last provisioning of b2qt was done in https://codereview.qt-project.org/c/qt/qt5/+/286213

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes