com php-src: Add switches for Spectre variant 1 mitigation: win32/build/confutils.js

From: Date: Wed, 17 Jan 2018 13:33:08 +0000
Subject: com php-src: Add switches for Spectre variant 1 mitigation: win32/build/confutils.js
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100941@lists.php.net to get a copy of this message
Commit: 043d53c7891e7f9437221acaf0fe0fd09a318b41 Author: Anatol Belski <ab@php.net> Wed, 17 Jan 2018 14:31:51 +0100 Parents: ea56fc840ef077b373c9a6e1d6cec348fc89d192 Branches: PHP-7.1 PHP-7.2 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=043d53c7891e7f9437221acaf0fe0fd09a318b41 Log: Add switches for Spectre variant 1 mitigation Changed paths: M win32/build/confutils.js Diff: diff --git a/win32/build/confutils.js b/win32/build/confutils..js index a75546c..d8a8e34 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -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");

« previous php.cvs (#100941) next »