[PATCH] D142404: [docs] Prefer setting LLVM_HOST_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE and LLVM_TARGET_ARCH

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 14:32:57 PST 2023


beanz added a comment.

In D142404#4074962 <https://reviews.llvm.org/D142404#4074962>, @mstorsjo wrote:

> 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?

I think you're misunderstanding how some of this works (or maybe rather the implications of it). As a concrete example: If my host build development is Ubuntu-x86, and I'm building LLVM to run on Android-AArch64, and I'm building a JIT to run on Android-AArch64. I NEED the `LLVM_TARGET_ARCH` to be AArch64, otherwise my JIT when run on Android will attempt to target x86.

I also _probably_ want the default target triple to be `aarch64-linux-...`, because I probably want the clang I build to infer AArch64-linux as its default architecture.

Setting `LLVM_HOST_TRIPLE` to Aarch64 on my x86 machine is likely to cause lots of problems, instead allowing it to be inferred from my build machine is appropriate. `LLVM_HOST_TRIPLE` should only be set explicitly in the odd case where my host machine's architecture and OS can't be identified by our build system.


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