summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/opcache/config.w325
-rw-r--r--win32/build/config.w322
-rw-r--r--win32/build/confutils.js15
3 files changed, 17 insertions, 5 deletions
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
index 280ce228c6..af160b207c 100644
--- a/ext/opcache/config.w32
+++ b/ext/opcache/config.w32
@@ -1,9 +1,8 @@
ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes");
-if (PHP_OPCACHE != "no") {
+var PHP_OPCACHE_PGO = false;
- PHP_PGI = "no"; // workaround
- PHP_PGO = "no"; // workaround
+if (PHP_OPCACHE != "no") {
EXTENSION('opcache', "\
ZendAccelerator.c \
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 68159eecab..3fe8469a90 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -255,12 +255,10 @@ if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
// CFLAGS, LDFLAGS and BUILD_DIR are defined
// Add compiler and link flags if PGO options are selected
if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
- ADD_FLAG('DLL_LDFLAGS', "/LTCG:PGINSTRUMENT");
ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
DEFINE("PGOPGD_DIR", "$(BUILD_DIR)");
}
else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
- ADD_FLAG('DLL_LDFLAGS', "/LTCG:PGUPDATE");
ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
DEFINE("PGOPGD_DIR", ((PHP_PGO.length == 0 || PHP_PGO == "yes") ? "$(BUILD_DIR)" : PHP_PGO));
}
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index e8b784f352..1dbc75b280 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1230,6 +1230,8 @@ function ADD_EXTENSION_DEP(extname, dependson, optional)
return true;
}
+var static_pgo_enabled = false;
+
function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
{
var objs = null;
@@ -1320,6 +1322,19 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")");
ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")");
ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")");
+ if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
+ if (!static_pgo_enabled) {
+ if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
+ ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG:PGINSTRUMENT");
+ }
+ else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
+ ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG:PGUPDATE");
+ }
+
+ ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
+ static_pgo_enabled = true;
+ }
+ }
/* find the header that declares the module pointer,
* so we can include it in internal_functions.c */