com php-src: fix disabling PGO for extensions, rel bug #65715: ext/opcache/config.w32 win32/build/config.w32 win32/build/confutils.js
| From: | Anatol Belski | Date: | Tue, 25 Mar 2014 05:44:54 +0000 |
| Subject: | com php-src: fix disabling PGO for extensions, rel bug #65715: ext/opcache/config.w32 win32/build/config.w32 win32/build/confutils.js | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76587@lists.php.net to get a copy of this message | ||
Commit: 7477f5b387c2a492cc29ddd30a0d3d0b0a6a9952
Author: Anatol Belski <ab@php.net> Tue, 25 Mar 2014 06:44:54 +0100
Parents: 223f7d9a44332fc08574a18af0266da45c42f340
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7477f5b387c2a492cc29ddd30a0d3d0b0a6a9952
Log:
fix disabling PGO for extensions, rel bug #65715
Bugs:
https://bugs.php.net/65715
Changed paths:
M ext/opcache/config.w32
M win32/build/config.w32
M win32/build/confutils.js
Diff:
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
index 280ce22..af160b2 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 dba2d10..569907b 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 490f864..136b3bb 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -1228,6 +1228,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;
@@ -1318,6 +1320,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 */