[PATCH] D54461: [CMake] Support cross-compiling with multi-stage builds

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 19:18:33 PST 2018


phosek created this revision.
phosek added a reviewer: beanz.
Herald added subscribers: llvm-commits, mgorny.
Herald added a reviewer: alexshap.

When using multi-stage builds, we would like support cross-compilation.
Example is 2-stage build when the first stage is compiled for host while
the second stage is compiled for the target.

Normally, the second stage would be also used for compiling runtimes,
but that's not possible when cross-compiling, so we use the first stage
compiler instead. However, we still want to use the second stage paths.
To do so, we set the -resource-dir of the first stage compiler to point
to the resource directory of the second stage.

We also need compiler tools that support the target architecture. These
tools are not guaranteed to be present on the host, but in case of
multi-stage build, we can build these tools in the first stage.


Repository:
  rL LLVM

https://reviews.llvm.org/D54461

Files:
  clang/CMakeLists.txt
  llvm/cmake/modules/LLVMExternalProjectUtils.cmake

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54461.173805.patch
Type: text/x-patch
Size: 4579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/8b35bc9e/attachment.bin>


More information about the llvm-commits mailing list