mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Add switches for Spectre variant 1 mitigation
This commit is contained in:
parent
ea56fc840e
commit
043d53c789
1 changed files with 13 additions and 0 deletions
|
@ -3068,6 +3068,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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue