Skip to content

Commit f052e99

Browse files
committed
Enable whole program optimization for builds without PGO, too
1 parent e282c40 commit f052e99

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

win32/build/confutils.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,9 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
12211221
}
12221222

12231223
ldflags += " /PGD:$(PGOPGD_DIR)\\" + makefiletarget.substring(0, makefiletarget.indexOf(".")) + ".pgd";
1224+
} else if (PHP_DEBUG != "yes") {
1225+
ADD_FLAG('CFLAGS_' + SAPI, "/GL");
1226+
ADD_FLAG('LDFLAGS_' + SAPI, "/LTCG");
12241227
}
12251228

12261229
if (MODE_PHPIZE) {
@@ -1421,6 +1424,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
14211424
ADD_FLAG('CFLAGS_' + EXT, "/GL /O2");
14221425

14231426
ldflags = " /PGD:$(PGOPGD_DIR)\\" + dllname.substring(0, dllname.indexOf(".")) + ".pgd";
1427+
} else if (PHP_DEBUG != "yes") {
1428+
ADD_FLAG('CFLAGS_' + EXT, "/GL");
1429+
ADD_FLAG('LDFLAGS_' + EXT, "/LTCG");
14241430
}
14251431

14261432
MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);
@@ -1463,6 +1469,9 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
14631469
ADD_FLAG("STATIC_EXT_CFLAGS", "/GL /O2");
14641470
static_pgo_enabled = true;
14651471
}
1472+
} else if (PHP_DEBUG != "yes") {
1473+
ADD_FLAG("STATIC_EXT_CFLAGS", "/GL");
1474+
ADD_FLAG('STATIC_EXT_LDFLAGS', "/LTCG");
14661475
}
14671476

14681477
/* find the header that declares the module pointer,

0 commit comments

Comments
 (0)