[cfe-dev] Cross-compiling Clang on Gentoo Linux

Jakov Smolic via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 9 08:48:26 PDT 2020


> On Ubuntu 20.04 I have
>
> /usr/bin/llvm-tblgen
> /usr/bin/llvm-tblgen-10
> /usr/lib/llvm-10/bin/llvm-tblgen
> /usr/local/bin/llvm-tblgen

Yes, I have those binaries as well. `llvm-tblgen` is, unlike
`clang-tblgen`, installed as part of the llvm package in Gentoo. I can
successfully cross-compile llvm. Likewise as clang, llvm requires the
`tblgen` binary for cross-compiling, but it's not an issue as it is
installed along with other llvm components.

> The first three were installed from the distribution. The last was
> compiled from the llvm-project at github. I do not have a
> clang- tblgen.
>
> Is your sequence something like this?

> https://github.com/llvm/llvm-project
> git clone https://github.com/llvm/llvm-project.git
> cd llvm-project
>
> And then what do you do?

I did not perform it directly like that, rather as part of the
packaging, but Gentoo, being source-based distribution, downaloads the
source and compiles the components from there, and sets some CMake
options [1].

Regards,
Jakov Smolic


[1] https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/llvm/llvm-10.0.0.ebuild#n249


More information about the cfe-dev mailing list