[clang] [clang] Support --sysroot= for ${arch}-windows-msvc targets (PR #96417)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 1 12:53:47 PDT 2024
trcrsired wrote:
> > > I've read half the patch so far, but wanted to ask before continuing: would it be possible (and simpler) to extend the /winsysroot support somehow to also handle --sysroot?
> > > (It would also be easier to review if the unrelated formatting changes were removed or split to a separate PR.)
> > >
> > > * @aganea and @mstorsjo in case you have comments too.
> >
> >
> > no. i do not use clang-cl. /winsysroot is not sysroot. /winsysroot is for clang-cl. not clang itself
> > sysroot is what the usually the clang and GCC means. That is not a semantics for msvc.
> > I have checked the code first clang does not support /winsysroot, second they have very different meanings which make them incompatible. Just use --sysroot because --sysroot matches the behavior of other platforms, including GNU variants of windows targets like x86_64-windows-gnu.
> > BTW using --sysroot gives the same semantics for build systems like build tools cmake or xmake.
>
> I didn't mean that you should _use_ `/winsysroot`, I was asking whether `--sysroot` and `/winsysroot` could share code for implementation.
They couldn't. They mean different things.
1. Settings --sysroot will disable all existing environment settings. The behavior is different.
2. The file structures are completely different. winsysroot has a very complicated file structures that need to reference while --sysroot is not.
3. --sysroot supports -stdlib=libc++ while other settings do not.
https://github.com/llvm/llvm-project/pull/96417
More information about the cfe-commits
mailing list