In a fully set-up MSVC environment (e.g. an environment set-up by Visual Studio's vcvarsall.bat) with a target of AArch64 ($Env:VSCMD_ARG_TGT_ARCH == arm64) or ARM ($Env:VSCMD_ARG_TGT_ARCH == arm), LDC will set-up an MSVC environment for x86-64 or x86, even if the -mtriple supplied to LDC is aarch64-windows or arm-windows (for example).
This results in the wrong libraries being supplied to the linker, and C files being preprocessed for the wrong target when cl is used for preprocessing.
In a fully set-up MSVC environment (e.g. an environment set-up by Visual Studio's
vcvarsall.bat
) with a target of AArch64 ($Env:VSCMD_ARG_TGT_ARCH
==arm64
) or ARM ($Env:VSCMD_ARG_TGT_ARCH
==arm
), LDC will set-up an MSVC environment for x86-64 or x86, even if the-mtriple
supplied to LDC isaarch64-windows
orarm-windows
(for example).This results in the wrong libraries being supplied to the linker, and C files being preprocessed for the wrong target when
cl
is used for preprocessing.This seems to be because
setupMsvcEnvironmentImpl
expects onlyx64
orx86
for theVSCMD_ARG_TGT_ARCH
environment variable: https://github.com/ldc-developers/ldc/blob/b75fc4cd0dcdb55ef3be1904e2ddce9355a10a95/driver/tool.cpp#L295-L300