[cfe-users] clang-tblgen not installed

Richard Smith via cfe-users cfe-users at lists.llvm.org
Fri Sep 6 17:40:46 PDT 2019


On Thu, 5 Sep 2019 at 20:19, Alex Biddulph via cfe-users <
cfe-users at lists.llvm.org> wrote:

> Hi,
>
> Is there a reason why clang-tblgen is not installed with all of the
> other clang binaries?
>
> According to
> http://releases.llvm.org/8.0.0/docs/HowToCrossCompileLLVM.html
> clang-tblgen (along with llvm-tblgen) are needed if you want to
> cross-compile clang, but since clang-tblgen is not installed during the
> normal installation process this means that system packages (like those
> available for Arch Linux) don't provide a clang-tblgen requiring me to
> build a local clang that I can then use to cross-compile clang. This is
> at odds with LLVM which does install llvm-tblgen.
>
> Is this a bug, or is there a reason why clang-tblgen is not installed?
>

clang-tblgen is only used as part of the process of building clang itself,
and is tied to the revision of clang that it was built as part of. If
you're building a custom clang binary, you should build a clang-tblgen
binary yourself from the same sources that you're using to build the rest
of clang. A preinstalled version from a (potentially) different revision of
clang should not be expected to work. As such, I don't think it's
appropriate to install clang-tblgen.

The story for llvm-tblgen is a bit different: that should be part of the
development package for LLVM, and installed when the LLVM headers are
installed (not when the LLVM binaries are installed). The reason is that
out-of-tree backends for LLVM will want to invoke llvm-tblgen on
out-of-tree .td files, in order to generate portions of the code for those
backends. There is no comparable reason to want clang-tblgen installed --
even code using clang as a library, and using clang's C++ API rather than
the C API, has no need of clang-tblgen (assuming that the generated headers
are shipped as part of the development package, which they should be).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20190906/0ae27392/attachment.html>


More information about the cfe-users mailing list