[cfe-dev] libclang shared library that exports all symbols

Pirama Arumuga Nainar via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 26 15:59:58 PDT 2018


libclang.so exports only the symbols needed by the C API.  This is in
contrast to libLLVM.so that exports all symbols from the LLVM static
libraries.  Would it be useful to provide a libclang shared library that
exports all symbols for use by tools that use Clang's (admittedly
non-backwards-compatible) C++ API?

We can either:
1. Add a new shared library (libclang_full.so?) that is built based on a
CMake option.
2. Export all symbols from the current libclang.so.  We'd have to also
include a few additional libraries such as libClangAnalysis.  Tools using
the C API are still restricted to the stable interface if they use the
clang-c headers.

Motivation:
There are a few Clang-based tools used by Android's build system (1, 2)
that use the C++ API.  They are built using Android build rules but need to
link against Android's Clang toolchain that's built with CMake.  We don't
want to include the libclang static libraries with the toolchain for space
considerations, and also to avoid exposing Clang's build internals
(internal library dependences and changes to them) to downstream tools.

Do other Clang/LLVM toolchain maintainers face similar issues and have
solutions that are applicable here?

[1]
https://android.googlesource.com/platform/development/+/master/vndk/tools/header-checker/
[2]
https://android.googlesource.com/platform/development/+/master/vndk/tools/vtable-dumper/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180726/f1c885df/attachment.html>


More information about the cfe-dev mailing list