[clangd-dev] clangd and cross compiled projects

Kadir Çetinkaya via clangd-dev clangd-dev at lists.llvm.org
Mon Feb 17 01:12:07 PST 2020


Hi Kai, in addition to what Theodore suggested;

if you are compiling your project with a custom toolchain, you might wanna
take a look at --query-driver option, described in
https://clang.llvm.org/extra/clangd/Configuration.html#id2

On Mon, Feb 10, 2020 at 8:55 PM Theodore Dubois via clangd-dev <
clangd-dev at lists.llvm.org> wrote:

> I use clangd with -target flags in compile_commands.json. You could
> also see if your Hexagon clang includes a clangd binary of its own.
>
> ~Theodore
>
> On Mon, Feb 10, 2020 at 9:36 AM Kai Ting via clangd-dev
> <clangd-dev at lists.llvm.org> wrote:
> >
> > Hello,
> >
> > Is there a way to pass a compile target flag to clangd? I primarily work
> with code cross-compiled using the Hexagon clang tool chain. The vanilla
> clang on my host PC generates a lot of errors for inline ASM code (e.g
> "unknown register name 'r0' in asm"). I noticed that I can pass
> "-ferror-limit=0" in compile_commands.json so that the number of
> diagnostics can exceed the default 20. This makes make wonder whether I can
> just tell clangd the target architecture. I tried but it seems architecture
> flags are ignored by clangd.
> >
> > I verified that the official LLVM 9 binary can generate Hexgon code -
> e.g.  "clang -target hexagon -c test.c" generates a valid .o output with
> hexagon assembly.  So it seems not far fetched that one can make clangd
> support various registered targets of llvm. If this is possible and not
> implemented, I'd like to contribute.
> >
> > Before migrating to clangd, I have been using libclang based plugin
> YouCompleteMe. This works out well for my purpose since I can switch
> libclang used by YCM with libclang from the Hexagon tool chain.
> Unfortunately, this is not possible with clangd.
> >
> > Thanks for the great work!
> >
> > -Kai
> >
> >
> > _______________________________________________
> > clangd-dev mailing list
> > clangd-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
> _______________________________________________
> clangd-dev mailing list
> clangd-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/clangd-dev/attachments/20200217/e7c900e2/attachment.html>


More information about the clangd-dev mailing list