When building on macOS, as in, using the depends/builders/darwin.mk, we currently use xcrun to determine the right paths for well-known tools.
https://github.com/bitcoin/bitcoin/blob/8da1e43b63cb36759eeb1fcfd6768163265c44e2/depends/builders/darwin.mk#L1-L22
However, it seems like:
- We can just invoke the tools directly (e.g.
clangvs$(xcrun -f clang)) - Invoking tools directly will give have behavior that we expect without extra flags: #18743 (comment)
My hypothesis is that the right way to invoke clang on macOS for non-Xcode projects like ours is to invoke it directly (which is what a naive build script would expect), and that $(xcrun -f clang) is being specialized for Xcode, which is why it doesn't work too well without extra flags as seen here: #18743