question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clang Kit scanning will accidentally use GCC for C++

See original GitHub issue

Brief Issue Summary

The Clang kit scan is broken with current LLVM 11. It will show as

image

and then call CMake with only the CMAKE_C_COMPILER set. This leads to the mixing of GCC and Clang toolchains

image

This is very subtle and causes a lot of confusion.

Expected:

  1. Kits without a C++ compiler should not show if the project is C++. Or such kits should have a different style to warn users.
  2. LLVM 11.1 Kits should be properly detected

CMake Tools Log

[kit] Found Kit: GCC for aarch64-linux-gnu 10.2.0
[kit] Found Kit: GCC for aarch64-linux-gnu 10.2.0
[kit] Found Kit: GCC for arm-none-eabi 10.2.0
[kit] Found Kit: GCC for arm-none-eabi 10.2.0
[kit] Found Kit: Clang 11.1.0
[kit] Found Kit: Clang 11.1.0
[kit] Found Kit: GCC 10.2.0
[kit] Found Kit: GCC 7.4.1
[kit] Found Kit: GCC 8.4.0
[kit] Found Kit: GCC 9.3.0
[kit] Found Kit: GCC for riscv64-linux-gnu 10.2.0
[kit] Found Kit: GCC for riscv64-linux-gnu 10.2.0
[kit] Found Kit: GCC for riscv64-unknown-elf 8.2.0
[kit] Found Kit: GCC for riscv64-unknown-elf 8.2.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 10.2.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 10.2.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 7.4.1
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 7.4.1
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 8.4.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 8.4.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 9.3.0
[kit] Found Kit: GCC for x86_64-pc-linux-gnu 9.3.0
[kit] Found Kit: GCC 10.2.0
[kit] Successfully loaded 15 kits from /home/fan/.local/share/CMakeTools/cmake-tools-kits.json

Platform and Versions

  • Operating System: Arch Linux
  • CMake Version: 3.20.1
  • VSCode Version: 1.55.1
  • CMake Tools Extension Version: 1.6.0
  • Compiler/Toolchain: LLVM 11.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
andreeiscommented, May 7, 2021

Unfortunately, the logging for the kits scanning feature is not very useful. We will improve it and once the change is merged in the code base we will create a vsix for you to reproduce this issue again and send us better logs. Until then, you can complete your kit definition with the CXX compiler and make sure you don’t scan again (it will overwrite your edit). Let us know if you encounter any issues with fixing the kit definition directly in the kits file.

2reactions
minhducsun2002commented, Apr 28, 2021

Can confirm identical behaviour with VS Code 1.55.2, CMake Tools 1.7.1, and similar LLVM & CMake version on Arch Linux.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GCC not recognized anymore · Issue #1821
loggingLevel to debug permitted me to see GCC is not recognized (sorry output ... Clang Kit scanning will accidentally use GCC for C++...
Read more >
GCC or Clang : r/C_Programming
You need both. Clang has much more features, less bugs and better warnings. GCC is the standard.
Read more >
The Best and Worst GCC Compiler Flags For Embedded
In this article we will explore some of the best and worst compiler flags for GCC (and Clang). Our focus will be on...
Read more >
Language Compatibility - Clang - LLVM
In general, Clang is highly compatible with the GCC inline assembly extensions, allowing the same set of constraints, modifiers and operands as GCC...
Read more >
3.13 Options Controlling the Preprocessor
These options control the C preprocessor, which is run on each C source file before actual compilation. If you use the -E option,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found