Commit e345067
committed
fix: prefer xcrun SDK over cfg-baked sysroot on macOS
probe_sysroot() called -print-sysroot first, which on macOS with
xlings LLVM just echoed back the --sysroot from clang++.cfg. That
cfg-baked path points to CommandLineTools SDK, which may differ from
the active Xcode SDK. When the two SDKs have different header
versions, std module precompilation fails with undeclared _CTYPE_A
and related C runtime macro errors.
Fix: on macOS, probe xcrun --show-sdk-path FIRST (always returns the
active SDK), then fall back to -print-sysroot for non-macOS. The
xcrun sysroot passed on the command line overrides the cfg-baked one.1 parent 722cb0e commit e345067
1 file changed
Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
257 | 266 | | |
258 | 267 | | |
259 | 268 | | |
| |||
262 | 271 | | |
263 | 272 | | |
264 | 273 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | 274 | | |
277 | 275 | | |
278 | 276 | | |
| |||
0 commit comments