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

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 24 07:49:51 PST 2018


thakis marked an inline comment as done.
thakis added a comment.

Thanks



================
Comment at: llvm/utils/gn/secondary/clang/tools/libclang/BUILD.gn:16-17
+if (host_os == "linux") {
+  # Linux needs -fPIC to build shared libs but they aren't on by default.
+  # For now, make libclang a static lib there.
+  libclang_target_type = "static_library"
----------------
phosek wrote:
> 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.
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.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56059/new/

https://reviews.llvm.org/D56059





More information about the cfe-commits mailing list