Skip to content

Commit 1d7e20d

Browse files
committed
Sync with upstream: ext/opcache, ext/sockets
1 parent 8973cca commit 1d7e20d

File tree

10 files changed

+35
-27
lines changed

10 files changed

+35
-27
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ repository.
77

88
* C11 standard
99

10-
New configuration variables:
10+
New configuration options:
1111

1212
* PHP_SYSTEM_GLOB
1313

14+
Removed configuration options:
15+
16+
* PHP_EXT_OPCACHE
17+
1418
## PHP 8.4
1519

1620
New configuration variables:

cmake/cmake/platforms/Windows.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
5151
# known on Windows targets.
5252
##############################################################################
5353

54+
set(HAVE_ACCEPT4 FALSE)
5455
set(HAVE_ALPHASORT FALSE)
5556
set(HAVE_ARC4RANDOM_BUF FALSE)
5657
set(HAVE_ARPA_INET_H FALSE)

cmake/cmake/presets/all-disabled.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"PHP_EXT_FILTER": false,
1616
"PHP_EXT_ICONV": false,
1717
"PHP_EXT_LIBXML": false,
18-
"PHP_EXT_OPCACHE": false,
1918
"PHP_EXT_PDO": false,
2019
"PHP_EXT_PDO_SQLITE": false,
2120
"PHP_EXT_PHAR": false,

cmake/ext/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ set_property(
3030
hash
3131
json
3232
lexbor
33+
opcache
3334
pcre
3435
random
3536
reflection

cmake/ext/opcache/CMakeLists.txt

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ This extension enables the PHP OPcode caching engine.
55
66
## PHP_EXT_OPCACHE
77
8+
:red_circle: *Removed as of PHP 8.5.*
9+
810
* Default: `ON`
911
* Values: `ON|OFF`
1012
11-
Enable the extension. This extension is always built as shared when enabled.
13+
Enable the extension. This extension is always built as shared when enabled. As
14+
of PHP 8.5, this extension is always enabled and cannot be disabled.
1215
1316
## PHP_EXT_OPCACHE_HUGE_CODE_PAGES
1417
@@ -44,46 +47,32 @@ include(CMakeDependentOption)
4447
include(FeatureSummary)
4548
include(PHP/SearchLibraries)
4649

47-
option(PHP_EXT_OPCACHE "Enable the Zend OPcache extension" ON)
4850
add_feature_info(
4951
"ext/opcache"
50-
PHP_EXT_OPCACHE
52+
TRUE
5153
"PHP OPcode caching engine"
5254
)
5355

5456
cmake_dependent_option(
5557
PHP_EXT_OPCACHE_HUGE_CODE_PAGES
5658
"Enable copying PHP CODE pages into HUGE PAGES"
5759
ON
58-
[[PHP_EXT_OPCACHE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
60+
[[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
5961
OFF
6062
)
6163

62-
cmake_dependent_option(
63-
PHP_EXT_OPCACHE_JIT
64-
"Enable JIT (just-in-time) compilation"
65-
ON
66-
PHP_EXT_OPCACHE
67-
OFF
68-
)
64+
option(PHP_EXT_OPCACHE_JIT "Enable JIT (just-in-time) compilation" ON)
6965

70-
cmake_dependent_option(
66+
option(
7167
PHP_EXT_OPCACHE_CAPSTONE
7268
"Support OPcache JIT disassembly through Capstone engine"
73-
OFF
74-
PHP_EXT_OPCACHE
75-
OFF
7669
)
7770

78-
if(NOT PHP_EXT_OPCACHE)
79-
return()
80-
endif()
81-
8271
################################################################################
8372
# Add library.
8473
################################################################################
8574

86-
add_library(php_ext_opcache MODULE)
75+
add_library(php_ext_opcache OBJECT)
8776

8877
target_sources(
8978
php_ext_opcache

cmake/ext/sockets/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ target_link_libraries(
9191
$<$<PLATFORM_ID:Windows>:ws2_32;iphlpapi>
9292
)
9393

94+
cmake_push_check_state(RESET)
95+
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
96+
check_symbol_exists(accept4 "sys/types.h;sys/socket.h" HAVE_ACCEPT4)
97+
cmake_pop_check_state()
98+
9499
cmake_push_check_state(RESET)
95100
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
96101
check_symbol_exists(hstrerror "netdb.h;sys/socket.h" HAVE_HSTRERROR)

cmake/ext/sockets/cmake/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* Define to 1 if you have the 'accept4' function. */
2+
#cmakedefine HAVE_ACCEPT4 1
3+
14
/* Define to 1 if you have the 'hstrerror' function. */
25
#cmakedefine HAVE_HSTRERROR 1
36

docs/cmake/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,19 +2337,19 @@ A list of Autoconf `configure` command-line configuration options, Windows
23372337
<td>--enable-opcache</td>
23382338
<td>--enable-opcache</td>
23392339
<td>PHP_EXT_OPCACHE=ON</td>
2340-
<td>default, will be shared</td>
2340+
<td>default, will be shared; removed since PHP >= 8.5</td>
23412341
</tr>
23422342
<tr>
23432343
<td>&emsp;--enable-opcache=shared</td>
23442344
<td>--enable-opcache=shared</td>
23452345
<td>PHP_EXT_OPCACHE=ON</td>
2346-
<td>will be shared</td>
2346+
<td>will be shared; removed since PHP >= 8.5</td>
23472347
</tr>
23482348
<tr>
23492349
<td>&emsp;--disable-opcache</td>
23502350
<td>--disable-opcache</td>
23512351
<td>PHP_EXT_OPCACHE=OFF</td>
2352-
<td></td>
2352+
<td>removed since PHP >= 8.5</td>
23532353
</tr>
23542354
<tr>
23552355
<td>&emsp;--enable-huge-code-pages</td>

docs/cmake/ext/opcache.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ This extension enables the PHP OPcode caching engine.
77

88
## PHP_EXT_OPCACHE
99

10+
:red_circle: *Removed as of PHP 8.5.*
11+
1012
* Default: `ON`
1113
* Values: `ON|OFF`
1214

13-
Enable the extension. This extension is always built as shared when enabled.
15+
Enable the extension. This extension is always built as shared when enabled. As
16+
of PHP 8.5, this extension is always enabled and cannot be disabled.
1417

1518
## PHP_EXT_OPCACHE_HUGE_CODE_PAGES
1619

docs/evolution.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,11 +941,14 @@ PHP coding standards now use the C11 standard.
941941
50.1 to 57.1.
942942
* Minimum required SQLite library version has been increased from 3.7.7 to
943943
3.7.17.
944-
* Bundled file library in ext/fileinfo upgraded to 5.46.
944+
* Bundled file library in ext/fileinfo has been upgraded from 5.45 to 5.46.
945945
* Bundled pcre2lib in ext/pcre upgraded from 10.44 to 10.45.
946946
* Added new extensions lexbor and uri as always enabled.
947947
* The `SIZEOF_INTMAX_T` preprocessor macro has been removed.
948948
* The `SIZEOF_PTRDIFF_T` preprocessor macro has been removed.
949+
* The Opcache extension (ext/opcache) is now always built into the PHP binary
950+
and is always loaded. The `--enable-opcache`/`--disable-opcache` configure
951+
options have been removed.
949952
950953
#### Autotools
951954

0 commit comments

Comments
 (0)