cquery icon indicating copy to clipboard operation
cquery copied to clipboard

Cross compile project throws errors such as "unknown register name 'r0' in asm"

Open hgijeon opened this issue 8 years ago • 3 comments

I'm using cmake for compiling ARM cortex-M4 binaries. However, cquery sometimes shows red underline on assembly codes which use ARM-specific registers. Is it came from that cquery uses clang, instead of arm-none-eabi-gcc? Then is there any configuration to select specific compiler?

Also, every #ifdef __cplusplus extern "C" { #endif causes "expected identifier or '('" error.

Furthermore, it cannot resolve gnu primitive definition, such as __attribute__((weak)).

hgijeon avatar Jun 18 '18 13:06 hgijeon

Does your code compile in clang? cquery uses clang under the hood, so compilation with clang is a requirement.

jacobdufault avatar Jun 18 '18 14:06 jacobdufault

Thank you for responding! Okay, got it. As the cmake project uses gcc arm toolchain, I just wonder if it is possible to lint with arm compiler, rather than clang. So, will it be any chance to use arm gcc toolchain or arm cross compile clang for linting? Or, is it impossible due to technical issues?

hgijeon avatar Jun 18 '18 14:06 hgijeon

Sorry, this is not possible. cquery is based on libclang APIs, which contains detail that gcc developers do not expose.

jacobdufault avatar Jun 18 '18 16:06 jacobdufault