[PATCH] D142404: [docs] Prefer setting LLVM_HOST_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE and LLVM_TARGET_ARCH
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 23 14:25:42 PST 2023
mstorsjo added a comment.
In D142404#4074957 <https://reviews.llvm.org/D142404#4074957>, @barannikov88 wrote:
> I believe this is wrong? You're specifying the host triple, i.e. the platform on which the (built) compiler should run.
Yes - but this whole article is about cross compiling LLVM so that the compiler itself will run on a different architecture. When doing that, AFAIK it's customary to tell the LLVM CMake build system what kind of triple it actually is running on, i.e. setting `LLVM_HOST_TRIPLE` is possibly relevant whenever cross compiling.
Then secondly, if you're on OS/arch X, and are cross compiling LLVM to run on OS/arch Y, then it's of course possible to give it a default target triple and for a third OS/arch Z - but as far as I understood this article, it's about a case where Y and Z are equal, i.e. running on whatever system, building LLVM to run on ARM, to generate code for ARM.
Plus, since `LLVM_TARGET_ARCH` is the target to use for JIT generation, it essentially needs to be the same architecture as the host on which LLVM is going to run, so it can't really be set to a wildly different arch anyway?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142404/new/
https://reviews.llvm.org/D142404
More information about the llvm-commits
mailing list