From: David Gebler Date: Tue, 2 Feb 2021 15:44:21 +0000 (+0100) Subject: Add IL compat flag to Windows builds X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d7fe25003bf36120f163ed245201c7551421aab;p=php Add IL compat flag to Windows builds Enabled by default; use `--disable-vs-link-compat` to disable. Closes GH-6658. --- diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 19fbd52aa9..38a5fb75aa 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3404,6 +3404,12 @@ function toolset_setup_common_ldlags() ADD_FLAG('LDFLAGS', "/GUARD:CF"); } } + if (PHP_VS_LINK_COMPAT != "no") { + // Allow compatible IL versions, do not require an exact match. + // Prevents build failures where different libs were built with different (but compatible) IL versions. + // See fatal error C1047. + ADD_FLAG("LDFLAGS", "/d2:-AllowCompatibleILVersions "); + } } } @@ -3753,3 +3759,9 @@ function setup_verbosity() CMD_MOD2 = "@"; } } + +try { + ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes'); +} catch (e) { + STDOUT.WriteLine("problem: " + e); +}