[PATCH] D134972: [CMake] Only set LLVM_DEFAULT_TARGET_TRIPLE to LLVM_HOST_TRIPLE when native target is enabled

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 09:17:27 PDT 2022


smeenai added a comment.

In D134972#3844420 <https://reviews.llvm.org/D134972#3844420>, @python3kgae wrote:

> In D134972#3844340 <https://reviews.llvm.org/D134972#3844340>, @smeenai wrote:
>
>> Sorry for the slow review.
>>
>> Does this mean that LLVM_DEFAULT_TARGET_TRIPLE will now be empty when the native target isn't enabled (since LLVM_DEFAULT_TARGET_TRIPLE_default won't be set)? Does that cause any problems?
>
> Thanks for reviewing.
> Yes. Now LLVM_DEFAULT_TARGET_TRIPLE will be empty when the native target is not enabled.
> check-llvm passed with this change (It fails when the native target is not enabled without this change. I only tested Linux build on x86 though.)

What about check-clang? What does clang do in this case if you try a compile without specifying an explicit triple?

Conceptually, requiring the user to explicitly pick a default target triple from one of the backends they have enabled seems cleaner than having it be empty to me. We'd error out if you don't have the native target enabled and didn't explicitly specify LLVM_DEFAULT_TARGET_TRIPLE. Would that work for you?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134972/new/

https://reviews.llvm.org/D134972



More information about the llvm-commits mailing list