Skip to content

Commit 7d7fe25

Browse files
dwgeblercmb69
authored andcommitted
Add IL compat flag to Windows builds
Enabled by default; use `--disable-vs-link-compat` to disable. Closes GH-6658.
1 parent 8b21e4e commit 7d7fe25

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

win32/build/confutils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,6 +3404,12 @@ function toolset_setup_common_ldlags()
34043404
ADD_FLAG('LDFLAGS', "/GUARD:CF");
34053405
}
34063406
}
3407+
if (PHP_VS_LINK_COMPAT != "no") {
3408+
// Allow compatible IL versions, do not require an exact match.
3409+
// Prevents build failures where different libs were built with different (but compatible) IL versions.
3410+
// See fatal error C1047.
3411+
ADD_FLAG("LDFLAGS", "/d2:-AllowCompatibleILVersions ");
3412+
}
34073413
}
34083414
}
34093415

@@ -3753,3 +3759,9 @@ function setup_verbosity()
37533759
CMD_MOD2 = "@";
37543760
}
37553761
}
3762+
3763+
try {
3764+
ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes');
3765+
} catch (e) {
3766+
STDOUT.WriteLine("problem: " + e);
3767+
}

0 commit comments

Comments
 (0)