You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build: Only replace cl.exe with clang-cl for ARM64 Windows builds
When cross-compiling to Windows from Linux or similar, it's common to
use the `clang-cl` driver from the LLVM toolchain which supports parsing
`cl.exe`-like arguments.
Ring however doesn't seem to compile for ARM64 Windows using `cl.exe`,
and contains a `// FIXME`-style workaround to use `clang` to compile its
C files instead.
The command-line interface for `clang` isn't always compatible with that
of `cl.exe` and `clang-cl`. There didn't seem to be any trouble with
this yet, but when cross-compiling from Linux it's common to explicitly
provide "sysroots" via `-vctoolsdir` and `-winsdkdir` in `CFLAGS`.
In such a setup this workaround in `ring` would pass those arguments
to `clang`, resulting in "unknown argument" errors.
`cc-rs` can tell us exactly what compiler it found, and we can use
this information to decide how to fill in this workaround. If the user
was already compiling their code with `clang-cl`, nothing has to be
replaced. In the end, all this entails is changing the workaround to not
compile with `clang`, but with `clang-cl` instead.
0 commit comments