microsoft / microsoft/vscode-cpptools
Add support for armcc compiler
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Type: LanguageService
I'm using CMake Tools extension as configurationProvider for cpptools, CMake files are correctly parsed and ARM Compiler toolchain is selected (via my Toolchain.cmake file).
However, it seems cpptools extension does not support ARM Compiler.
This is ARM Compiler -> link (it's proprietary ARM compiler, a license is needed to use the compiler, but I could provide whatever compiler output you may need).
Describe the bug
- OS and Version: Windows 10
- VS Code Version: 1.52.0
- C/C++ Extension Version: v1.1.3
- Other extensions you installed (and if the issue persists after disabling them): CMake Tools
After configuration has been provided via CMake Tools, cpptools gives the following C/C++ Configuration Warning:
[17/12/2020, 09:34:04] Unable to resolve configuration with compilerPath "c:/program files (x86)/arm_compiler_5.06u4/bin64/armcc.exe". Using "cl.exe" instead.
The path to ARM Compiler is correct, the executable is there.
Steps to reproduce
You cannot reproduce without an active ARM Compiler license.
Expected behavior
C/C++ extension also supports ARM proprietary compilers.
Logs
Insert logs here.
Screenshots
Additional context
Here you can find more details about compiler defines/includes. (I already supported a similar work for an Eclipse IDE plugin some time ago).
Quotes from above link:
For built-in macros and includes, I provide here armcc case as an example:
Built-in macros are provided by the compiler with
armcc --list_macros dummy.c(dummy.ccan be empty). I could just feed your Parser with this command, whose output is like the following:#define __STDC__ 1 #define __STDC_VERSION__ 199409L #define __EDG__ 1 #define __EDG_VERSION__ 407 #define __EDG_SIZE_TYPE__ unsigned int #define __EDG_PTRDIFF_TYPE__ int #define __sizeof_int 4 #define __sizeof_long 4 #define __sizeof_ptr 4 #define __ARMCC_VERSION 5060422 #define __TARGET_CPU_ARM7TDMI 1 #define __TARGET_FPU_SOFTVFP 1 #define __CC_ARM 1 #define __arm 1 #define __arm__ 1 #define __TARGET_ARCH_4T 1 #define __TARGET_ARCH_ARM 4 #define __TARGET_ARCH_THUMB 1 #define __TARGET_ARCH_A64 0 #define __TARGET_ARCH_AARCH32 1 #define __TARGET_FEATURE_HALFWORD 1 #define __TARGET_FEATURE_THUMB 1 #define __TARGET_FEATURE_MULTIPLY 1 #define __TARGET_FEATURE_EXTENSION_REGISTER_COUNT 0 #define __a32__ 1 #define __OPTIMISE_SPACE 1 #define __OPT_SMALL_ASSERT 1 #define __OPTIMISE_LEVEL 2 #define __SOFTFP__ 1There is no armcc command line argument to get the list of include directories. The only include directory is fixed, and it is simply
../include(relative to the location of armcc executable). I could feed your Built-in parser with this path.
Luckily, I see that everything seems well documented. You can find all info starting from the link to the docs I provided above. Moreover, I can suggest other specific links of interests (you can easily find them navigating through docs by yourself):
- Link to Compiler command-line options and search paths (you can also see
../includethere);- Link to Factors influencing how the compiler searches for header files;
- Link to Compiler search rules and the current place;
- Link to The ARMCC5INC environment variable.
Additionally, I want to point out that I'm using version 5 of the ARM compiler, but there is version 6 also. With version 6, ARM seems to switch to clang-compatible compiler. I provide also a link to version 6 command line options here.
Here in section 1.1 Support level definitions they say:
Arm Compiler 6 is built on LLVM technology and preserves the functionality of that technology where possible. This means that there are additional features available in Arm Compiler that are not listed in the documentation. These additional features are known as community features. For information on these community features, see the documentation for the Clang/LLVM project.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit der Pfadbehandlung von configuration-provider für den gemeldeten compilerPath, c:/program files (x86)/arm_compiler_5.06u4/bin64/armcc.exe, und den Fallback auf cl.exe. Verwenden Sie die bereitgestellte Ausgabe von armcc --list_macros dummy.c sowie den compilerrelativen ../include-Pfad als erwartete Eingaben und überprüfen Sie anschließend, dass die CMake Tools-Konfiguration die Warnung nicht mehr erzeugt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cmake, cpp
- Bereich
- build-system, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100