[llvm] cb19e3b - [docs] Prefer setting LLVM_HOST_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE and LLVM_TARGET_ARCH

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 00:56:51 PST 2023


Author: Martin Storsjö
Date: 2023-02-03T10:54:29+02:00
New Revision: cb19e3b20d9297a1efdbc197fa0f6c9b001971a4

URL: https://github.com/llvm/llvm-project/commit/cb19e3b20d9297a1efdbc197fa0f6c9b001971a4
DIFF: https://github.com/llvm/llvm-project/commit/cb19e3b20d9297a1efdbc197fa0f6c9b001971a4.diff

LOG: [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

Added: 
    

Modified: 
    llvm/docs/HowToCrossCompileLLVM.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/HowToCrossCompileLLVM.rst b/llvm/docs/HowToCrossCompileLLVM.rst
index 258d3a2eab6fc..1e6f74b144aae 100644
--- a/llvm/docs/HowToCrossCompileLLVM.rst
+++ b/llvm/docs/HowToCrossCompileLLVM.rst
@@ -43,12 +43,16 @@ The CMake options you need to add are:
  * ``-DCMAKE_SYSTEM_NAME=<target-system>``
  * ``-DCMAKE_INSTALL_PREFIX=<install-dir>``
  * ``-DLLVM_NATIVE_TOOL_DIR=<path-to-host-bin>``
- * ``-DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabihf``
- * ``-DLLVM_TARGET_ARCH=ARM``
+ * ``-DLLVM_HOST_TRIPLE=arm-linux-gnueabihf``
  * ``-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.
 
+Also note that ``LLVM_HOST_TRIPLE`` specifies the triple of the system
+that the cross built LLVM is going to run on - the flag is named based
+on the autoconf build/host/target nomenclature. (This flag implicitly sets
+other defaults, such as ``LLVM_DEFAULT_TARGET_TRIPLE``.)
+
 If you're compiling with GCC, you can use architecture options for your target,
 and the compiler driver will detect everything that it needs:
 


        


More information about the llvm-commits mailing list