Skip to content

Commit f64ea16

Browse files
committed
Add various improvements
- Rechecked interprocedural optimization (IPO/LTO). - PHP_LTO option renamed to PHP_IPO. - Fixed typo in patches updater script. - Synced CS.
1 parent 397cafb commit f64ea16

4 files changed

Lines changed: 16 additions & 13 deletions

File tree

bin/update-patches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ for php in $phpVersions; do
131131
fi
132132

133133
# Update stub files if any.
134-
"$phpExecutable" build/get_stub.php
134+
"$phpExecutable" build/gen_stub.php
135135
if test -n "$($git status --porcelain)"; then
136136
"$git" add .
137137
"$git" commit --amend --no-edit

cmake/cmake/modules/PHP/Core/Optimization.cmake

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,20 @@ This module also checks whether IPO/LTO can be enabled based on the PHP
1616
configuration (due to global register variables) and compiler/platform.
1717
1818
https://cmake.org/cmake/help/latest/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html
19-
20-
TODO: Recheck Clang errors as OBJECT libraries doesn't seem to work.
21-
TODO: Recheck and add PHP_LTO option to docs.
2219
#]=============================================================================]
2320

2421
include_guard(GLOBAL)
2522

26-
option(PHP_LTO "Build PHP with link time optimization (LTO) if supported")
27-
mark_as_advanced(PHP_LTO)
23+
option(PHP_IPO "Enable interprocedural optimization (IPO/LTO)")
24+
mark_as_advanced(PHP_IPO)
2825

2926
block(PROPAGATE CMAKE_INTERPROCEDURAL_OPTIMIZATION)
30-
set(enable_ipo ${PHP_LTO})
27+
set(enable_ipo ${PHP_IPO})
3128
set(reason "")
3229

33-
if(NOT PHP_LTO)
34-
set(enable_ipo FALSE)
30+
if(NOT PHP_IPO)
3531
# Disabled.
32+
set(enable_ipo FALSE)
3633
elseif(
3734
CMAKE_C_COMPILER_ID STREQUAL "GNU"
3835
AND (

cmake/ext/mbstring/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,19 @@ target_sources(
8787
mbstring.h
8888
)
8989

90-
target_compile_definitions(php_ext_mbstring PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE)
90+
target_compile_definitions(
91+
php_ext_mbstring
92+
PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE
93+
)
9194

9295
target_include_directories(php_ext_mbstring PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
9396

9497
# The mbstring extension doesn't seem to support interprocedural optimization
95-
# (IPO).
96-
set_target_properties(php_ext_mbstring PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF)
98+
# (IPO/LTO).
99+
set_target_properties(
100+
php_ext_mbstring
101+
PROPERTIES INTERPROCEDURAL_OPTIMIZATION FALSE
102+
)
97103

98104
set_property(
99105
TARGET php_ext_mbstring

patches/8.6/cmake.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ index e691bd3964b..12745d29cb9 100644
290290
+# Local user presets
291291
+/CMakeUserPresets.json
292292
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
293-
index edccbeae564..df88ce86d9e 100644
293+
index 11111140679..0c2c671140f 100644
294294
--- a/ext/standard/proc_open.c
295295
+++ b/ext/standard/proc_open.c
296296
@@ -52,7 +52,7 @@

0 commit comments

Comments
 (0)