Skip to content

Commit cb19e3b

Browse files
committed
[docs] Prefer setting LLVM_HOST_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE and LLVM_TARGET_ARCH
Setting LLVM_HOST_TRIPLE propagates the information to a few more places than if only setting LLVM_TARGET_ARCH and LLVM_DEFAULT_TARGET_TRIPLE, while both of those settings get their defaults implied from LLVM_HOST_TRIPLE if they're not overridden. Differential Revision: https://reviews.llvm.org/D142404
1 parent 830d116 commit cb19e3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/docs/HowToCrossCompileLLVM.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ The CMake options you need to add are:
4343
* ``-DCMAKE_SYSTEM_NAME=<target-system>``
4444
* ``-DCMAKE_INSTALL_PREFIX=<install-dir>``
4545
* ``-DLLVM_NATIVE_TOOL_DIR=<path-to-host-bin>``
46-
* ``-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf``
47-
* ``-DLLVM_TARGET_ARCH=ARM``
46+
* ``-DLLVM_HOST_TRIPLE=arm-linux-gnueabihf``
4847
* ``-DLLVM_TARGETS_TO_BUILD=ARM``
4948

5049
Note: ``CMAKE_CROSSCOMPILING`` is always set automatically when ``CMAKE_SYSTEM_NAME`` is set. Don't put ``-DCMAKE_CROSSCOMPILING=TRUE`` in your options.
5150

51+
Also note that ``LLVM_HOST_TRIPLE`` specifies the triple of the system
52+
that the cross built LLVM is going to run on - the flag is named based
53+
on the autoconf build/host/target nomenclature. (This flag implicitly sets
54+
other defaults, such as ``LLVM_DEFAULT_TARGET_TRIPLE``.)
55+
5256
If you're compiling with GCC, you can use architecture options for your target,
5357
and the compiler driver will detect everything that it needs:
5458

0 commit comments

Comments
 (0)