[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:46:08 PST 2023


mstorsjo added a comment.

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

> In D142404#4074985 <https://reviews.llvm.org/D142404#4074985>, @mstorsjo wrote:
>
>> 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.
>
> Ooof... That is the most terribly named variable ever. You are right. I kinda hate the idea of documenting this because that variable name is unnecessarily confusing.

Yeah, it's not really great - but changing it would be kinda a lot of churn for all users who are cross compiling LLVM.

Anyway, my main point here is that whenever you're cross compiling, you more or less do need to set `LLVM_HOST_TRIPLE` - but you generally don't need to set `LLVM_TARGET_ARCH` and `LLVM_DEFAULT_TARGET_TRIPLE` unless you're doing a really, really exotic build. So the documentation should probably explain the most basic cross compilation case, not the most exotic one.

> In fact, the line directly above the line you changed uses the word `host` to mean something completely different.

Ouch, I hadn't noticed that detail. We probably should reword those bits too, to make it even clearer.


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