[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:35:37 PST 2023


mstorsjo added a comment.

In D142404#4074967 <https://reviews.llvm.org/D142404#4074967>, @beanz wrote:

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

Yes, I agree

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

I also agree

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

No, here I disagree. `LLVM_HOST_TRIPLE` is documented as `Host on which LLVM binaries will run`, not as the host where I'm currently compiling it. We can easily infer the details of the OS where we're doing the build, but usually much less so for the cross target, where the cross compiled LLVM will run.


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