[PATCH] D141196: [cmake] Don't require third-party components when cross-compiling

James Le Cuirot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 13:37:38 PST 2023


chewi added a comment.

It's hard to demonstrate, but I'll explain in more detail. Gentoo disables the options here <https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/llvm/llvm-16.0.0.9999.ebuild?id=e6819ab985d4#n351>. If they weren't disabled, you'd need the **third-party** directory/component present here <https://github.com/llvm/llvm-project/blob/1b60f0d73c34fec4648bb05f98db75008a50f4d8/llvm/CMakeLists.txt#L1178-L1180> and here <https://github.com/llvm/llvm-project/blob/1b60f0d73c34fec4648bb05f98db75008a50f4d8/llvm/CMakeLists.txt#L1336-L1351>. That's fine for a regular build, but with a cross build, CMake is invoked a second time so that it can build and execute binaries on the build host (e.g. llvm-tblgen). This happens here <https://github.com/llvm/llvm-project/blob/1b60f0d73c34fec4648bb05f98db75008a50f4d8/llvm/CMakeLists.txt#L1123> and here <https://github.com/llvm/llvm-project/blob/1b60f0d73c34fec4648bb05f98db75008a50f4d8/llvm/cmake/modules/CrossCompile.cmake#L71-L88>. That second invocation doesn't pass through any of the original CMake arguments, so `LLVM_INCLUDE_TESTS` and `LLVM_INCLUDE_BENCHMARKS` get enabled by default, and the build breaks because **third-party** is missing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141196



More information about the llvm-commits mailing list