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

--sysroot is not respected when executing toolchain.prf

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.8, 5.15.0
    • Fix Version/s: None
    • Component/s: Build tools: qmake
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      I recently wanted to switch from qmake 3.0 to qmake 3.1.
      Qmake 3.1 fails if run for exactly the same environment as qmake 3.0.

      Command:

      qmake -d project.pro -spec some_spec_dir
      

      Result:

      Project ERROR: Cannot run compiler '/home/user/tizen-studio/tools/arm-linux-gnueabi-gcc-6.2/bin/arm-linux-gnueabi-g++'. Output:
      ===================
      # 1 "/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp"
      ===================
      Maybe you forgot to setup the environment?
      
      

      I was able to narrow down problem to this call inside toolchain.prf:

      vars = $$qtVariablesFromGCC($$QMAKE_CXX)
      

      This is translated to this call:

      /home/user/tizen-studio/tools/arm-linux-gnueabi-gcc-6.2/bin/arm-linux-gnueabi-g++ -E /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp
      

      Which fails with this message:

      cc1plus: error: /root/.dibs/srib-dibs-builder-s32-u64/workspace/jobs/50729/buildRoot/rs-devel_glibc-2.24.armv7l/usr/local/include: Permission denied
      cc1plus: error: /root/.dibs/srib-dibs-builder-s32-u64/workspace/jobs/50729/buildRoot/rs-devel_glibc-2.24.armv7l/usr/include: Permission denied
      

      My compiler version:

      /home/user/tizen-studio/tools/arm-linux-gnueabi-gcc-6.2/bin/arm-linux-gnueabi-gcc -v
      Using built-in specs.
      COLLECT_GCC=/home/user/tizen-studio/tools/arm-linux-gnueabi-gcc-6.2/bin/arm-linux-gnueabi-gcc
      COLLECT_LTO_WRAPPER=/home/user/tizen-studio/tools/arm-linux-gnueabi-gcc-6.2/bin/../libexec/gcc/arm-tizen-linux-gnueabi/6.2.1/lto-wrapper
      Target: arm-tizen-linux-gnueabi
      Configured with: ../configure --prefix=/root/.dibs/srib-dibs-builder-s32-u64/workspace/jobs/50729/source/install-arm-linux-gnueabi-gcc-6.2-linux --program-prefix=arm-linux-gnueabi- --enable-languages=c,c++ --enable-checking=release --disable-libssp --disable-bootstrap --disable-libvtv --disable-libgcj --with-sysroot=/root/.dibs/srib-dibs-builder-s32-u64/workspace/jobs/50729/buildRoot/rs-devel_glibc-2.24.armv7l --enable-__cxa_atexit --enable-libstdcxx-allocator=new --enable-linker-build-id --without-system-libunwind --enable-threads=posix --disable-multilib --disable-libquadmath --enable-lto --enable-libgfortran --disable-nls --target=arm-tizen-linux-gnueabi --with-pkgversion='Tizen/Linaro GCC 6.2.1 2017.05' --with-bugurl=http://bugs.tizen.org/ --enable-plugin --with-system-zlib --disable-sjlj-exceptions --with-arch=armv7-a --with-tune=cortex-a8 --with-float=softfp --with-fpu=vfpv3-d16
      Thread model: posix
      gcc version 6.2.1 20161213 (Tizen/Linaro GCC 6.2.1 2017.05)
      

      As you can see my compiler has some default sysroot path. Although I set

      QMAKE_CXXFLAGS = my_sysroot
      

      this is ignored during calling ...macros.cpp
      If I run:

      /home/user/tizen-studio/tools/arm-linux-gnueabi-gcc-6.2/bin/arm-linux-gnueabi-g++ --sysroot=/home/user/tizen-studio/platforms/tizen-4.0/wearable/rootstraps/wearable-4.0-device.core -E /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp
      

      then it returns with:

      /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp 
      # 1 "/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp"
      # 1 "<built-in>"
      # 1 "<command-line>"
      # 1 "/home/user/tizen-studio/platforms/tizen-4.0/wearable/rootstraps/wearable-4.0-device.core/usr/include/stdc-predef.h" 1 3 4
      # 1 "<command-line>" 2
      # 1 "/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp"
      
      QT_COMPILER_STDCXX = 201402L
      # 26 "/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/data/macros.cpp"
      QMAKE_GCC_MAJOR_VERSION = 6
      QMAKE_GCC_MINOR_VERSION = 2
      QMAKE_GCC_PATCH_VERSION = 1
      

      I think it is a bug. I set my sysroot properly but it is ignored.
      As a workaround I put this line to my *.conf:

      QMAKE_CXX.COMPILER_MACROS = "garbage"
      

      and then everything compiles just fine but I guess it is rather bad practice.
      Please investigate this.

        Attachments

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

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            somerandomname zzzz zzzz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes