[PATCH] D136315: [clang][Darwin] Try to guess the SDK root with xcrun when unspecified

Steven Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 10:19:01 PST 2023


steven_wu added a comment.

In D136315#4069582 <https://reviews.llvm.org/D136315#4069582>, @calebzulawski wrote:

> That makes more sense, I thought perhaps it was using `DEFAULT_SYSROOT`.  The shim isn't smart enough to choose the sysroot from the target unfortunately.
>
> It looks like the only error is unrelated to this change, something with concepts in libc++.

The shim only works if you invoke `/usr/bin/clang`, and that shim is for building host OS. I am not sure it is a desirable behavior for clang to call into `xcrun` because it can be very slow on first invocation and you will get error if you don't have Xcode or Commandlinetools installed (on a basic macOS install basically).

I wonder if the better solution is print a very actionable diagnostics when building c++ but standard c++ library cannot be found.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136315



More information about the cfe-commits mailing list