From 2fcf41d1955c06a565e054ea6cc30ef7708ecb13 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 6 Aug 2019 09:35:02 -0700 Subject: [PATCH] Compile Windows releases with a static CRT This commit compiles all Rust code for the Windows release with `-Ctarget-feature=+crt-static`. This is targeted at increasing the binary compatibility of the binaries built to not rely on DLLs that aren't always installed on Windows. Notably this statically links the C runtime (notably used by the C++ code) and means that the final binary relies on fewer dlls. This in theory means that the binaries are only limited by the number of APIs they use from Windows. Note that this also matches how we build releases of Rust for MSVC. --- .azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 7e4145b1457f..a6c73b598a70 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -95,6 +95,9 @@ jobs: matrix: windows: imageName: 'vs2017-win2016' + # Statically link against msvcrt to produce slightly more portable + # binaries on Windows by reducing our binary compatibility requirements. + RUSTFLAGS: -Ctarget-feature=+crt-static linux: imageName: 'ubuntu-16.04' mac: