<div dir="ltr"><div dir="ltr">On Thu, 5 Sep 2019 at 20:19, Alex Biddulph via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Is there a reason why clang-tblgen is not installed with all of the <br>
other clang binaries?<br>
<br>
According to <br>
<a href="http://releases.llvm.org/8.0.0/docs/HowToCrossCompileLLVM.html" rel="noreferrer" target="_blank">http://releases.llvm.org/8.0.0/docs/HowToCrossCompileLLVM.html</a> <br>
clang-tblgen (along with llvm-tblgen) are needed if you want to <br>
cross-compile clang, but since clang-tblgen is not installed during the <br>
normal installation process this means that system packages (like those <br>
available for Arch Linux) don't provide a clang-tblgen requiring me to <br>
build a local clang that I can then use to cross-compile clang. This is <br>
at odds with LLVM which does install llvm-tblgen.<br>
<br>
Is this a bug, or is there a reason why clang-tblgen is not installed?<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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).</div></div></div>