]> granicus.if.org Git - php/commitdiff
fix disabling PGO for extensions, rel bug #65715
authorAnatol Belski <ab@php.net>
Tue, 25 Mar 2014 05:44:54 +0000 (06:44 +0100)
committerAnatol Belski <ab@php.net>
Tue, 25 Mar 2014 05:44:54 +0000 (06:44 +0100)
ext/opcache/config.w32
win32/build/config.w32
win32/build/confutils.js

index 280ce228c641dbe275ac45690866cdaba84d69b0..af160b207cf73499880b0ec2d39f74aa18e5b4dc 100644 (file)
@@ -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 \
index dba2d106480e2b004788d5374115f89980d4a8c4..569907baf55c7a31b9ad58781a66b770ed396c0e 100644 (file)
@@ -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));
 }
index 490f86457358e70ab5006b03e4b32d7b431edd7a..136b3bb0243d0908b0aecd23f2e7aea8940dbfe4 100644 (file)
@@ -1228,6 +1228,8 @@ function ADD_EXTENSION_DEP(extname, dependson, optional)
        return true;\r
 }\r
 \r
+var static_pgo_enabled = false;\r
+\r
 function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)\r
 {\r
        var objs = null;\r
@@ -1318,6 +1320,19 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
                ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")");\r
                ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")");\r
                ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")");\r
+               if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {\r
+                       if (!static_pgo_enabled) {\r
+                               if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {\r
+                                       ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG:PGINSTRUMENT");\r
+                               }\r
+                               else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {\r
+                                       ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG:PGUPDATE");\r
+                               }\r
+\r
+                               ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");\r
+                               static_pgo_enabled = true;\r
+                       }\r
+               }\r
 \r
                /* find the header that declares the module pointer,\r
                 * so we can include it in internal_functions.c */\r