drodriguez wrote:

> But after taking a quick look, my impression is that this change reverses the 
> bug fixed in #70817.
> 
> To recap, that PR preferred the C++ headers available in the toolchain 
> distribution over the SDK headers, when the compiler was launched via a 
> symbolic link to the executable (a behaviour common to the npm/xpm ecosystem).
> 
> If I understand this proposal right (please correct me if I'm wrong), it will 
> move the SDK headers to the top of the list.
> 
> If this will happen only when an explicit `-isysroot` is passed on the 
> compiler command line, it might be ok, but if it will happen for all cases, 
> this will simply bring us back to the pre 70817 case, when builds on old 
> macOS-es (like 10.13) with a new clang (like 17.x) will fail, due to the out 
> of sync old headers from the SDK with the new library from the toolchain. I 
> wasted quite a lot of time to diagnose this subtle issue by that time.

Yes. What I think Dmitry and I are trying to explain is that it is very weird 
that providing an explicit `-isysroot` in the command line is ignored for the 
C++ headers (and only for them). One can start using `-nostdinc` and friends, 
but that mean rebuilding the header search paths manually, which is not great.

At least in my testing preferring the sysroot only happens when providing an 
explicit `-isysroot` in the command line, but also might be affected by the 
presence of `SDKROOT` in the environment (tools like `xcrun` set this value). 
If one is careful and avoid those two, the headers by the `clang` binary should 
be preferred.

https://github.com/llvm/llvm-project/pull/80524
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to