[PATCH] D86313: [runtimes] Allow LLVM_BUILTIN_TARGETS to include Darwin

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 13:17:12 PDT 2020


smeenai added a comment.

In D86313#2229152 <https://reviews.llvm.org/D86313#2229152>, @beanz wrote:

> I think this change makes configuration confusingly inaccurate. Since the compiler-rt Darwin build does not support picking and choosing which targets to configure making the configuration fail if a user tries to is the reasonable approach.
>
> Making the build do something different and unintuitive from what the configuration requested seems undesirable to me.

I'm not sure I understand.

I completely agree with you that it's misleading if e.g. a user specifies `x86_64-apple-macosx` and `arm64-apple-ios` in their LLVM_BUILTIN_TARGETS, and expects each of those configurations to only build the listed target. That's not how the Darwin compiler-rt build works.

However, `x86_64-apple-darwin` is more of a generic Darwin target. If someone understands that and just wants to add `x86_64-apple-darwin` to their LLVM_BUILTIN_TARGETS (and no other Apple targets) in order to build the builtins for all Apple targets, I don't see why we should disallow that.

I would argue that our current situation is actually misleading. You can add `x86_64-apple-macosx` to LLVM_BUILTIN_TARGETS without any configuration errors, and then you'll end up building a libclang_rt.ios.a that actually contains object files for macOS. Like I said, I'd be supportive of making this codepath complain if you specified a triple for a specific Apple platform, but I think the generic darwin triple should be fine.

Let me add a few more safeguards to this and see what you think. In particular, I'm even happy for darwin triples to still be an error by default, but to have a CMake option that one can set if they understand how the Darwin compiler-rt build works. (Triples for specific Apple platforms would always be an error.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86313



More information about the llvm-commits mailing list