[PATCH] D119804: [docs] HowToCrossCompileLLVM.rst: update cmake options

Siwei Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 18:43:28 PST 2022


fourdim created this revision.
fourdim added reviewers: andrew-wja, mgorny, lancethepants, smeenai.
fourdim requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch updates the cmake options suggested when cross compiling. This should fix #53662 <https://github.com/llvm/llvm-project/issues/53662>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119804

Files:
  llvm/docs/HowToCrossCompileLLVM.rst


Index: llvm/docs/HowToCrossCompileLLVM.rst
===================================================================
--- llvm/docs/HowToCrossCompileLLVM.rst
+++ llvm/docs/HowToCrossCompileLLVM.rst
@@ -40,7 +40,7 @@
 
 The CMake options you need to add are:
 
- * ``-DCMAKE_CROSSCOMPILING=True``
+ * ``-DCMAKE_SYSTEM_NAME=<target-system>``
  * ``-DCMAKE_INSTALL_PREFIX=<install-dir>``
  * ``-DLLVM_TABLEGEN=<path-to-host-bin>/llvm-tblgen``
  * ``-DCLANG_TABLEGEN=<path-to-host-bin>/clang-tblgen``
@@ -48,6 +48,8 @@
  * ``-DLLVM_TARGET_ARCH=ARM``
  * ``-DLLVM_TARGETS_TO_BUILD=ARM``
 
+Note: ``CMAKE_CROSSCOMPILING`` is always set automatically when `CMAKE_SYSTEM_NAME` is set. Don't put ``-DCMAKE_CROSSCOMPILING=TRUE`` in your options.
+
 If you're compiling with GCC, you can use architecture options for your target,
 and the compiler driver will detect everything that it needs:
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119804.408686.patch
Type: text/x-patch
Size: 877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220215/62a7e8dd/attachment.bin>


More information about the llvm-commits mailing list