Recently i've been working on some project with GNU arm compiler for C++ project. I've configured clangd to use this compiler with query-driver as clangd documentation recommends. The problem is clangd tries to use internal llvm include headers instead of compiler provided and fails.
$ from clangd logs for some system headers /path/to/compiler/aarch64-none-linux-gnu-g++ --target=aarch64-none-linux-gnu --driver-mode=g++ -v -c -x c++-header -resource-dir=/usr/lib/llvm-14/lib/clang/14.0.0 -- /path/to/tompiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/lib/gcc/aarch64-none-linux-gnu/11.3.1/include/arm_neon.h As it can be seen clangd sets resource-dir as if it was not compiled with my compiler.
Also there is problem with found headers. Clangd produces following search paths.
#include "..." search starts here: #include <...> search starts here: /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include/c++/11.3.1 /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include/c++/11.3.1/aarch64-none-linux-gnu /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include/c++/11.3.1/backward /usr/lib/llvm-14/lib/clang/14.0.0/include /usr/local/include /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include /usr/include End of search list. Calling compiler directly provides more include paths without llvm includes.
$ my_compiler -v -c -xc++ /dev/null #include "..." search starts here: #include <...> search starts here: /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include/c++/11.3.1 /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include/c++/11.3.1/aarch64-none-linux-gnu /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include/c++/11.3.1/backward /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/include /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/include-fixed /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../lib/gcc/aarch64-none-linux-gnu/11.3.1/../../../../aarch64-none-linux-gnu/include /path/to/compiler/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu/bin/../aarch64-none-linux-gnu/libc/usr/include End of search list. How can i fix this? Clangd version - 14.0.0