[clang] [clang] Support --sysroot= for ${arch}-windows-msvc targets (PR #96417)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 3 16:01:48 PDT 2024
trcrsired wrote:
> Similarly it'd be excellent if clang supported equivalents to clang-cl's `/winsdkdir` and `/vctoolsdir`, though these probably couldn't be smooshed into existing options like `/winsysroot` can with `--sysroot`.
@zmodem @godvino
I strongly oppose making ```/winsysroot``` working the same way as ```--sysroot```, and I would argue ```/winsysroot``` needs to be removed completely.
These setups are overly complex and lack support for libc++, making them practically useless. A GNU-style sysroot would solve everything, but Rust enthusiasts have complicated things by bringing in Cargo and micro-dependencies like xwin. I doubt xwin works well, especially since Microsoft's headers need fixes for case-sensitive filesystems—something that requires effort Microsoft isn't directly providing.
The last time I checked, even the Windows SDK has C headers mixed with standard C++ headers, and Microsoft's intrinsic headers don't work with Clang. Clang provides its own headers, like ```intrin.h```, which aren't compatible with Microsoft's implementation.
I guess xwin is maintained by rust people who have very little knowledge on how things really work for C and C++, so you end up with even larger mess.
This issue is exactly an example why just using microsoft's one does not work since basic all language compilers using the GNU's style sysroot rule.
https://github.com/Jake-Shadle/xwin/issues/138
https://github.com/trcrsired/windows-msvc-sysroot
https://github.com/llvm/llvm-project/pull/96417
More information about the cfe-commits
mailing list