Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-31001

Compiler feature detection failure!

    XMLWordPrintable

Details

    • Linux/X11
    • 2006ab3d2 (14.0)

    Description

      Hello,

      I'm working on a bazel project where compile_commands.json are generated.

      I'm using the `compile_commands.json` (AKA Compilation Database file) project to open it.

      I'm getting this kind of error messages (one per source file) whenever I'm opening it.

      Compiler feature detection failure!
      The command "/usr/bin/gcc '--sysroot=/external_toolchain_arm_armv8a/host/opt/rtc-toolchain-arm/arm-none-eabi' -frandom-seed=bazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/module/_objs/native_library_main_lib-c/module_aggr.o -fdata-sections -ffunction-sections -fno-strict-aliasing -fsigned-char -funwind-tables -nostdinc -fno-omit-frame-pointer -mfloat-abi=soft -mno-unaligned-access -mthumb -msoft-float '-B/external_toolchain_arm_armv8a/host/opt/rtc-toolchain-arm/arm-none-eabi/bin' '-B/external_toolchain_arm_armv8a/host/opt/rtc-toolchain-arm/arm-none-eabi/../lib/gcc' -march=armv7-r -mtune=cortex-r4 -x c -E -v -" terminated with exit code 1.
      Using built-in specs.
      COLLECT_GCC=/usr/bin/gcc
      OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
      OFFLOAD_TARGET_DEFAULT=1
      gcc: error: unrecognized command-line option '-mfloat-abi=soft'
      gcc: error: unrecognized command-line option '-mno-unaligned-access'
      gcc: error: unrecognized command-line option '-mthumb'
      Target: x86_64-linux-gnu
      Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-XeT9lY/gcc-11-11.4.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
      Thread model: posix
      Supported LTO compression algorithms: zlib zstd
      gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 

      The entry in `compile_commands.json` is like so

        {
          "directory": "/repo/lcarlier/my_repo",
          "file": "vobs/dsl/sw/flat/rtc-drivers-app/module/module_aggr.c",
          "command": "buildroot-symlinks/buildroot-const/host/bin/arm-none-eabi-gcc -MD -MF bazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/module/_objs/native_library_main_lib-c/module_aggr.d -frandom-seed=bazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/module/_objs/native_library_main_lib-c/module_aggr.o -DBAZEL_CURRENT_REPOSITORY=\"\" -iquote . -iquote bazel-out/k8-fastbuild-ST-036743408b5f/bin -iquote bazel-out/k8-fastbuild-ST-8276b31a66e5/bin -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/module/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/module/_virtual_includes/native_library_headers -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/common/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/ponss/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-framework-app/rtc-generic/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-common/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/rpmsg-lite/lib/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/occ/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/occ-lite/_virtual_includes/native_library_export -Ibazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/FreeRTOS/_virtual_includes/native_library_export -isystem buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include/c++/10.2.1 -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include/c++/10.2.1 -isystem buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include/c++/10.2.1/arm-none-eabi -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include/c++/10.2.1/arm-none-eabi -isystem buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include/c++/10.2.1/backward -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include/c++/10.2.1/backward -isystem buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/lib/gcc/arm-none-eabi/10.2.1/include -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/lib/gcc/arm-none-eabi/10.2.1/include -isystem buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/lib/gcc/arm-none-eabi/10.2.1/include-fixed -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/lib/gcc/arm-none-eabi/10.2.1/include-fixed -isystem buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/host/opt/rtc-toolchain-arm/arm-none-eabi/include -isystem buildroot-symlinks/buildroot-const/sysroot/usr/include -isystem bazel-out/k8-fastbuild-ST-8276b31a66e5/bin/buildroot-symlinks/buildroot-const/sysroot/usr/include -DCHX_FAMILY -DTARG_ARCH_REBORN -DTARG_OS_NONE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D__DATE__=\"redacted\" -D__STDC_FORMAT_MACROS=1 -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -Wno-builtin-macro-redefined -Wno-psabi -Wno-unused-parameter -fdata-sections -ffunction-sections -fno-strict-aliasing -fsigned-char -funwind-tables -g -nostdinc -Wall -fno-omit-frame-pointer -mfloat-abi=soft -mno-unaligned-access -mthumb -msoft-float -gz -B/external_toolchain_arm_armv8a/host/opt/rtc-toolchain-arm/arm-none-eabi/bin -B/external_toolchain_arm_armv8a/host/opt/rtc-toolchain-arm/arm-none-eabi/../lib/gcc -march=armv7-r -mtune=cortex-r4 -Os -DCOMPILER_GNU=950 -Werror -Wextra -D_LITTLE_ENDIAN=1 -DFEAT_RTC_COMPLEX_module -DFEAT_RTC_TYPE_BWM_module -DFEAT_RTC_DISABLE_PREEMPTION -DFEAT_COMPILER_GNU -DFEAT_TARG_ARCH_REBORN -DFEAT_ENDIAN_LITTLE --sysroot=/external_toolchain_arm_armv8a/host/opt/rtc-toolchain-arm/arm-none-eabi -c vobs/dsl/sw/flat/rtc-drivers-app/module/module_aggr.c -o bazel-out/k8-fastbuild-ST-036743408b5f/bin/vobs/dsl/sw/flat/rtc-drivers-app/module/_objs/native_library_main_lib-c/module_aggr.o"
        },

      It seems that QtCreator tries somehow to use the host compiler while the `compile_commands.json` points to something else. And of course the host compiler doesn't recognize

      gcc: error: unrecognized command-line option '-mfloat-abi=soft' 
      gcc: error: unrecognized command-line option '-mno-unaligned-access' 
      gcc: error: unrecognized command-line option '-mthumb'

      Since this is an x86 machine.

      I also try to make an ARM kit where I selected the arm cross compiler for C and C++ but it isn't taken either

       

      I think the best solution would be to use the compiler from the kit to detect the compiler feature.

       

      Can we fix this?

       

      Many thanks.

       

      Laurent

       

       

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-31001
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            lcarlier Laurent Carlier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes