Skip to content

Commit 6612e1b

Browse files
committed
more fixes related to bug #65715
1 parent 5efda76 commit 6612e1b

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

win32/build/config.w32

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
250250
// CFLAGS, LDFLAGS and BUILD_DIR are defined
251251
// Add compiler and link flags if PGO options are selected
252252
if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
253-
ADD_FLAG('CFLAGS', "/GL /O2");
254-
ADD_FLAG('LDFLAGS', "/LTCG:PGINSTRUMENT");
253+
ADD_FLAG('DLL_LDFLAGS', "/LTCG:PGINSTRUMENT");
254+
ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
255255
DEFINE("PGOPGD_DIR", "$(BUILD_DIR)");
256256
}
257257
else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
258-
ADD_FLAG('CFLAGS', "/GL /O2");
259-
ADD_FLAG('LDFLAGS', "/LTCG:PGUPDATE");
258+
ADD_FLAG('DLL_LDFLAGS', "/LTCG:PGUPDATE");
259+
ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
260260
DEFINE("PGOPGD_DIR", ((PHP_PGO.length == 0 || PHP_PGO == "yes") ? "$(BUILD_DIR)" : PHP_PGO));
261261
}
262262

win32/build/confutils.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,16 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
10821082
}
10831083

10841084
if(is_pgo_desired(sapiname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
1085+
// Add compiler and link flags if PGO options are selected
1086+
if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
1087+
ADD_FLAG('CFLAGS_' + SAPI, "/GL /O2");
1088+
ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG:PGINSTRUMENT");
1089+
}
1090+
else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
1091+
ADD_FLAG('CFLAGS_' + SAPI, "/GL /O2");
1092+
ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG:PGUPDATE");
1093+
}
1094+
10851095
ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd";
10861096
}
10871097

@@ -1268,6 +1278,16 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
12681278

12691279
ldflags = "";
12701280
if (is_pgo_desired(extname) && (PHP_PGI == "yes" || PHP_PGO != "no")) {
1281+
// Add compiler and link flags if PGO options are selected
1282+
if (PHP_DEBUG != "yes" && PHP_PGI == "yes") {
1283+
ADD_FLAG('LDFLAGS_' + EXT, "/LTCG:PGINSTRUMENT");
1284+
}
1285+
else if (PHP_DEBUG != "yes" && PHP_PGO != "no") {
1286+
ADD_FLAG('LDFLAGS_' + EXT, "/LTCG:PGUPDATE");
1287+
}
1288+
1289+
ADD_FLAG('CFLAGS_' + EXT, "/GL /O2");
1290+
12711291
ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
12721292
}
12731293

0 commit comments

Comments
 (0)