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

Sharadh Rajaraman via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 17:00:04 PDT 2025


sharadhr wrote:

There are a lot of unfounded accusations with which I will not engage. There are practical reasons for why an organisation will not take on a dependency or stewardship of a certain project, but they are not relevant here.

My points about pacman was to demonstrate how easy setting up a MinGW cross-compile is: it's literally two commands on most Linux systems: download the sysroot either as an archive or as a system package, download the compiler, compile. Done. 

___

All I am saying is—please write some documentation, and enhance the existing documentation for `/winsysroot`. It is high time _someone_ provided decent documentation for cross-compilation given at least two hosts and two targets, without users having to hunt through blog posts, old feature and merge requests, and scattered projects on GitHub (not just yours, mind you; this applies to _all_ the 'winsysroot' projects mentioned in this thread).

In particular, I would like to see:

- how users should reflow from `C:\Program Files\Microsoft Visual Studio\<version>\<edition>\VC` and `C:\Program Files (x86)\Windows Kits\10` to `sysroot/*` without any script or helper, because if we support a flag that expects a certain layout, we should support users by telling them how to prepare such a layout without any additional dependency;

- how users can use some libc++ with this new flag, and ideally why `/winsysroot` doesn't allow them to do so without massive pain;

- an exemplar demonstration for how all of this can be used to cross-compile, and compare with the following scenarios: `clang-cl /winsysroot`, `clang++ --target <target> -Xmicrosoft-windows-sys-root` etc. 

I hope this is considered, because I feel there's no point in providing a feature without _any_ documentation. Once this is merged this entire issue will disappear from search engines.

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


More information about the cfe-commits mailing list