This is an archive of the discontinued LLVM Phabricator instance.

[gn build] Add build files for clang/tools/{c-arcmt-test,c-index-test} and their dependency clang/tools/libclang
ClosedPublic

Authored by thakis on Dec 23 2018, 7:42 AM.

Details

Summary

libclang is somewhat incomplete. It's just enough to get check-clang to pass, but that requires it to be pretty complete. The biggest thing is that it's not built as a shared library on Linux. The libclang/BUILD.gn file has a comment with details on what else is missing.

Diff Detail

Repository
rL LLVM

Event Timeline

thakis created this revision.Dec 23 2018, 7:42 AM
phosek accepted this revision.Dec 24 2018, 12:38 AM
phosek marked an inline comment as done.

LGTM

llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
16–17 ↗(On Diff #179446)

We can solve this with toolchains, i.e. have a variant of the default toolchain that includes -fPIC which will be used to build libClang.so. Not something to do in this change, but definitely something we should look into in the future.

This revision is now accepted and ready to land.Dec 24 2018, 12:38 AM
This revision was automatically updated to reflect the committed changes.
thakis marked an inline comment as done.Dec 24 2018, 7:49 AM

Thanks

llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn
16–17 ↗(On Diff #179446)

Yup! I think we want several mechanisms:

  • llvm_enable_pic, like the cmake build. It should probably default to false
  • a toolchain setup, for people who want to redist clang without pic but libclang with pic. This makes building that convenient, but the pic difference means the one build dir will have to build more or less everything twice (once per toolchain), which for regular development is a bit annoying because it takes a bit longer.