[clang] [clang] Support --sysroot= for ${arch}-windows-msvc targets (PR #96417)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 27 00:05:46 PDT 2025
YexuanXiao wrote:
> But both need to automatically find a **normally-installed** MSVC SDK without a GNU-like refactor, and yes, that includes things like `Program Files(x86)`. So in other words it needs to work similar to how `/winsysroot` currently does.
They are different, just as clang-cl and clang++ are distinct to users.
> Then we can special-case `-stdlib=libc++` to internally set up the include and library paths to firstly sysroot if provided and then falling back to Clang's own libc++, instead of having the user do it manually [as linked above](https://github.com/llvm/llvm-project/issues/53004#issuecomment-1207167610). Since libc++ is distributed in GNU-style layout, this needs to use the resource directory to find the correct path for the headers and libraries.
>
> This is exactly what @zmodem [first asked](https://github.com/llvm/llvm-project/pull/96417?notification_referrer_id=NT_kwDOADlIYLMxMTIwODI4MjkyMTozNzU0MDgw#issuecomment-2200709561), and I concur.
This approach cannot achieve the goal. Microsoft uses mixed-case #include paths, and the STL and UCRT are distributed in the same directory. It does something similar to MinGW, but uses the files provided by Microsoft.
https://github.com/llvm/llvm-project/pull/96417
More information about the cfe-commits
mailing list