fix: arm64 binary does not run due to some missing windows dlls (#290)
This happens for example in fresh installs so now the Windows MSVC C
runtime is statically linked to solve the issue.
$ ldd static-web-server.exe
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffc41ff0000)
KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ffc408d0000)
KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ffc3d9b0000)
advapi32.dll => /c/Windows/System32/advapi32.dll (0x7ffc406b0000)
msvcrt.dll => /c/Windows/System32/msvcrt.dll (0x7ffc3f930000)
sechost.dll => /c/Windows/System32/sechost.dll (0x7ffc3fe60000)
RPCRT4.dll => /c/Windows/System32/RPCRT4.dll (0x7ffc3e5e0000)
ws2_32.dll => /c/Windows/System32/ws2_32.dll (0x7ffc40800000)
ucrtbase.dll => /c/Windows/System32/ucrtbase.dll (0x7ffc3e1e0000)
bcrypt.dll => /c/Windows/SYSTEM32/bcrypt.dll (0x7ffc3c7f0000)
VCRUNTIME140.dll => not found
api-ms-win-crt-math-l1-1-0.dll => not found
api-ms-win-crt-string-l1-1-0.dll => not found
api-ms-win-crt-heap-l1-1-0.dll => not found
api-ms-win-crt-runtime-l1-1-0.dll => not found
api-ms-win-crt-stdio-l1-1-0.dll => not found
api-ms-win-crt-locale-l1-1-0.dll => not found
ARM64 (after)
$ ldd static-web-server.exe
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffc41ff0000)
KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ffc408d0000)
KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ffc3d9b0000)
advapi32.dll => /c/Windows/System32/advapi32.dll (0x7ffc406b0000)
msvcrt.dll => /c/Windows/System32/msvcrt.dll (0x7ffc3f930000)
sechost.dll => /c/Windows/System32/sechost.dll (0x7ffc3fe60000)
RPCRT4.dll => /c/Windows/System32/RPCRT4.dll (0x7ffc3e5e0000)
ws2_32.dll => /c/Windows/System32/ws2_32.dll (0x7ffc40800000)
bcrypt.dll => /c/Windows/SYSTEM32/bcrypt.dll (0x7ffc3c7f0000)
CRYPTBASE.DLL => /c/Windows/SYSTEM32/CRYPTBASE.DLL (0x7ffc3c550000)
Diff
.cargo/config.toml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -1,7 +1,9 @@
[registries.crates-io]
protocol = "sparse"
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[target.aarch64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]