From: Anatol Belski Date: Tue, 11 Apr 2017 13:21:10 +0000 (+0200) Subject: Enable whole program optimization for builds without PGO, too X-Git-Tag: php-7.2.0alpha1~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f052e99df6f4b3bc4e2a1e9717ee36339a33f33b;p=php Enable whole program optimization for builds without PGO, too --- diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 43c2596bcf..fd76340248 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1221,6 +1221,9 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) } ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd"; + } else if (PHP_DEBUG != "yes") { + ADD_FLAG('CFLAGS_' + SAPI, "/GL"); + ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG"); } if (MODE_PHPIZE) { @@ -1421,6 +1424,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) ADD_FLAG('CFLAGS_' + EXT, "/GL /O2"); ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd"; + } else if (PHP_DEBUG != "yes") { + ADD_FLAG('CFLAGS_' + EXT, "/GL"); + ADD_FLAG('LDFLAGS_' + EXT, "/LTCG"); } MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname); @@ -1463,6 +1469,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2"); static_pgo_enabled = true; } + } else if (PHP_DEBUG != "yes") { + ADD_FLAG("STATIC_EXT_CFLAGS", "/GL"); + ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG"); } /* find the header that declares the module pointer,