diff options
author | Anatol Belski <ab@php.net> | 2018-01-17 14:48:06 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-01-17 14:48:06 +0100 |
commit | e9eff0a425d7fe43ac11a4395025cac6f804748b (patch) | |
tree | 8600af9512b5f299482b4b6c5e3963169e0e905d /win32/build/confutils.js | |
parent | f7f790fcc9d57bcd0b6d356994c67ec746a5ac23 (diff) | |
parent | f0aa379dc13a7cca7e2e858277559c80a0f87f9d (diff) | |
download | php-git-e9eff0a425d7fe43ac11a4395025cac6f804748b.tar.gz |
Merge branch 'PHP-7.2'
* PHP-7.2:
Add switches for Spectre variant 1 mitigation
Diffstat (limited to 'win32/build/confutils.js')
-rw-r--r-- | win32/build/confutils.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 5ce431e1e0..d588df78a7 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3177,6 +3177,19 @@ function toolset_setup_common_cflags() // Set some debug/release specific options ADD_FLAG('CFLAGS', ' /RTC1 '); } else { + if (PHP_DEBUG == "no" && PHP_SECURITY_FLAGS == "yes") { + /* Mitigations for Spectre variant 1, see + https://blogs.msdn.microsoft.com/vcblog/2018/01/15/spectre-mitigations-in-msvc/ + TODO backport for all supported VS versions when they release it. */ + if (VCVERS >= 1912) { + if (VCVERS >= 1913) { + ADD_FLAG('CFLAGS', "/Qspectre"); + } else { + /* Undocumented. */ + ADD_FLAG('CFLAGS', "/d2guardspecload"); + } + } + } if (VCVERS >= 1900) { if (PHP_SECURITY_FLAGS == "yes") { ADD_FLAG('CFLAGS', "/guard:cf"); |