Skip to content

RFC: take libclang as a dependency #2084

@graydon

Description

@graydon

Integrating libclang into our llvm build is a "very likely candidate" for solving all of the following issues:

I have a submodule'd version of the requisite pieces in my workspace here and it seems to work ok. It makes initial llvm build time longer and will involve expanding the librustllvm we ship (or shipping an additional lib). Not sure exactly how much, size-wise, but it seems to be a bit "pay as you go", so for example I think we could start using its driver module (that knows how to run various toolchains on different platforms) before we did anything concerning bindgen or compiling C code through our own libclang (vs. handing to the 'native' compiler).

Ideally, going down this road could eventually free us from using external toolchains at all; that is, once LLVM has its own linker, I expect the clang driver module will default to invoke it too, and at that point our download would be "self contained" on all platforms. Despite possibly carrying a C compiler in its belly.

Comments welcome. I realize this is a contentious proposal. But it seems like it'd be very useful, to me, and the "integration" into our build seems trivial (I just did it; took ~3 hours, mostly due to waiting on LLVM devs to fix a bug I hit).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationA-driverArea: rustc_driver that ties everything together into the `rustc` compilerA-frontendArea: Compiler frontend (errors, parsing and HIR)A-linkageArea: linking into static, shared libraries and binariesC-cleanupCategory: PRs that clean code up or issues documenting cleanup.C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions