[clang] [clang] Support --sysroot= for ${arch}-windows-msvc targets (PR #96417)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 01:42:33 PST 2026


zmodem wrote:

Sorry, I still don't think it's a good idea to have a `--sysroot` flag for using the MSVC libraries in a layout that's different from what MSVC ships.

At https://github.com/trcrsired/windows-msvc-sysroot#why-not-winsysroot you write

> Clang's winsysroot is pretty useless since it does not follow the rule of other targets are doing. That is a massive burden for libraries to maintain. Plus the file structures are overcomplicated to the point of useless.

As far as I'm aware, /winsysroot uses the file structure that the library comes in. That seems very reasonable to me.

For using clang with the MSVC libraries, I think the focus should be on making it easy to use the library out of the box.

I'm supportive of things like exposing `/winsysroot` in regular `clang` -- maybe even spelling it as `--sysroot` (that's what I thought this PR was about when I first looked) -- and of supporting case-insensitive lookup (as in https://github.com/llvm/llvm-project/pull/178585).

But I think that for ${arch}-windows-**msvc** targets, the toolchain should expect the libraries to be organized  as msvc organizes them.

https://github.com/llvm/llvm-project/pull/96417


More information about the cfe-commits mailing list