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

Caleb Zulawski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 16:11:33 PST 2023


calebzulawski added a comment.

In D136315#4070121 <https://reviews.llvm.org/D136315#4070121>, @steven_wu wrote:

> I definitely feel like if to fix your problem, a reverse option like `-infer-sdkroot-from-xcrun` might be better/safer but it doesn't help the general case where people doesn't know `/usr/bin/clang` is different from a regular clang that a regular clang needs to pass -isysroot.

I reversed the option for now since it seems the least objectionable.  I figure a future change could make this behavior automatic, or maybe even a compile-time configurable option?  Regarding the shim, if this option were to override `SDKROOT` it would still work with the shim, though I'm not sure which should be higher priority.  It would run `xcrun` twice, which isn't so good, but perhaps Apple could make use of this behavior in the shim, so it works with `--target`...


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