Skip to content

Commit 885a5be

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 95527c7 + 22c3143 commit 885a5be

9 files changed

+88
-142
lines changed

cmake/Zend/cmake/CheckFloatPrecision.cmake

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,16 @@
11
#[=============================================================================[
2-
# CheckFloatPrecision
3-
42
Check for x87 floating point internal precision control.
53
64
See: https://wiki.php.net/rfc/rounding
75
8-
## Cache variables
9-
10-
* `HAVE__FPU_SETCW`
11-
12-
Whether `_FPU_SETCW` is present and usable.
13-
14-
* `HAVE_FPSETPREC`
15-
16-
Whether `fpsetprec` is present and usable.
17-
18-
* `HAVE__CONTROLFP`
19-
20-
Whether `_controlfp` is present and usable.
21-
22-
* `HAVE__CONTROLFP_S`
23-
24-
Whether `_controlfp_s` is present and usable.
25-
26-
* `HAVE_FPU_INLINE_ASM_X86`
27-
28-
Whether FPU control word can be manipulated by inline assembler.
29-
30-
## Usage
6+
Cache variables:
317
32-
```cmake
33-
# CMakeLists.txt
34-
include(cmake/CheckFloatPrecision.cmake)
35-
```
8+
* HAVE__FPU_SETCW - Whether _FPU_SETCW is present and usable.
9+
* HAVE_FPSETPREC - Whether fpsetprec is present and usable.
10+
* HAVE__CONTROLFP - Whether _controlfp is present and usable.
11+
* HAVE__CONTROLFP_S - Whether _controlfp_s is present and usable.
12+
* HAVE_FPU_INLINE_ASM_X86 - Whether FPU control word can be manipulated by
13+
inline assembler.
3614
#]=============================================================================]
3715

3816
include_guard(GLOBAL)

cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
#[=============================================================================[
2-
# CheckGlobalRegisterVariables
3-
42
Check whether the compiler and target system support global register variables.
5-
63
Global register variables are relevant for the GNU C compatible compilers.
4+
See also https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html
75
8-
See also: [GCC global register variables](https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html)
9-
10-
## Cache variables
11-
12-
* `HAVE_GCC_GLOBAL_REGS`
6+
Result variables:
137
14-
Whether global register variables are supported.
15-
16-
## Usage
17-
18-
```cmake
19-
# CMakeLists.txt
20-
include(cmake/CheckGlobalRegisterVariables.cmake)
21-
```
8+
* HAVE_GCC_GLOBAL_REGS - Whether global register variables are supported.
229
#]=============================================================================]
2310

2411
include_guard(GLOBAL)
2512

13+
set(HAVE_GCC_GLOBAL_REGS FALSE)
14+
2615
# Skip in consecutive configuration phases.
27-
if(DEFINED HAVE_GCC_GLOBAL_REGS)
16+
if(DEFINED PHP_ZEND_HAS_GCC_GLOBAL_REGS)
17+
if(PHP_ZEND_HAS_GCC_GLOBAL_REGS)
18+
set(HAVE_GCC_GLOBAL_REGS TRUE)
19+
endif()
2820
return()
2921
endif()
3022

@@ -83,10 +75,11 @@ cmake_push_check_state(RESET)
8375
{
8476
return 0;
8577
}
86-
]] HAVE_GCC_GLOBAL_REGS)
78+
]] PHP_ZEND_HAS_GCC_GLOBAL_REGS)
8779
cmake_pop_check_state()
8880

89-
if(HAVE_GCC_GLOBAL_REGS)
81+
if(PHP_ZEND_HAS_GCC_GLOBAL_REGS)
82+
set(HAVE_GCC_GLOBAL_REGS TRUE)
9083
message(CHECK_PASS "yes")
9184
else()
9285
message(CHECK_FAIL "no")

cmake/Zend/cmake/CheckMMAlignment.cmake

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
#[=============================================================================[
2-
# CheckMMAlignment
3-
42
Test and set the alignment defines for the Zend memory manager (`ZEND_MM`). This
53
also does the logarithmic test.
64
7-
## Result variables
8-
9-
* `ZEND_MM_ALIGNMENT`
10-
* `ZEND_MM_ALIGNMENT_LOG2`
11-
* `ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT`
12-
13-
## Usage
5+
Result variables:
146
15-
```cmake
16-
# CMakeLists.txt
17-
include(cmake/CheckMMAlignment.cmake)
18-
```
7+
* ZEND_MM_ALIGNMENT
8+
* ZEND_MM_ALIGNMENT_LOG2
9+
* ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT
1910
#]=============================================================================]
2011

2112
include_guard(GLOBAL)

cmake/Zend/cmake/CheckStackDirection.cmake

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
#[=============================================================================[
2-
# CheckStackDirection
3-
42
Check whether the stack grows downwards. Assumes contiguous stack.
53
6-
## Cache variables
7-
8-
* `ZEND_CHECK_STACK_LIMIT`
9-
10-
Whether checking the stack limit is supported.
11-
12-
## Usage
4+
Result/cache variables:
135
14-
```cmake
15-
# CMakeLists.txt
16-
include(cmake/CheckStackDirection.cmake)
17-
```
6+
* ZEND_CHECK_STACK_LIMIT - Whether checking the stack limit is supported.
187
#]=============================================================================]
198

209
include_guard(GLOBAL)
@@ -24,6 +13,11 @@ if(DEFINED ZEND_CHECK_STACK_LIMIT)
2413
return()
2514
endif()
2615

16+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
17+
set(ZEND_CHECK_STACK_LIMIT TRUE)
18+
return()
19+
endif()
20+
2721
include(CheckSourceRuns)
2822
include(CMakePushCheckState)
2923

cmake/Zend/cmake/CheckStrerrorR.cmake

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
#[=============================================================================[
2-
# CheckStrerrorR
3-
4-
Check whether `strerror_r()` is the POSIX-compatible version or the GNU-specific
2+
Check whether strerror_r() is the POSIX-compatible version or the GNU-specific
53
version.
64
7-
## Cache variables
8-
9-
* `HAVE_STRERROR_R`
10-
11-
Whether `strerror_r()` is available.
12-
13-
* `STRERROR_R_CHAR_P`
14-
15-
Whether `strerror_r()` returns a `char *` message, otherwise it returns an
16-
`int` error number.
5+
Result variables:
176
18-
## Usage
19-
20-
```cmake
21-
# CMakeLists.txt
22-
include(cmake/CheckStrerrorR.cmake)
23-
```
7+
* HAVE_STRERROR_R - Whether strerror_r() is available.
8+
* STRERROR_R_CHAR_P - Whether strerror_r() returns a 'char *' message, otherwise
9+
it returns an 'int' error number.
2410
#]=============================================================================]
2511

2612
include_guard(GLOBAL)
@@ -29,14 +15,35 @@ include(CheckSourceCompiles)
2915
include(CheckSymbolExists)
3016
include(CMakePushCheckState)
3117

32-
check_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
18+
set(HAVE_STRERROR_R FALSE)
19+
set(STRERROR_R_CHAR_P FALSE)
3320

34-
if(NOT HAVE_STRERROR_R)
21+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
3522
return()
3623
endif()
3724

25+
check_symbol_exists(strerror_r string.h PHP_ZEND_HAS_STRERROR_R)
26+
27+
if(NOT PHP_ZEND_HAS_STRERROR_R)
28+
return()
29+
endif()
30+
31+
set(HAVE_STRERROR_R TRUE)
32+
33+
# Skip in consecutive configuration phases.
34+
if(DEFINED PHP_ZEND_HAS_STRERROR_R_CHAR_P)
35+
if(PHP_ZEND_HAS_STRERROR_R_CHAR_P)
36+
set(STRERROR_R_CHAR_P TRUE)
37+
return()
38+
endif()
39+
endif()
40+
41+
message(CHECK_START "Checking strerror_r() return type")
42+
3843
cmake_push_check_state(RESET)
3944
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
45+
set(CMAKE_REQUIRED_QUIET TRUE)
46+
4047
check_source_compiles(C [[
4148
#include <string.h>
4249
@@ -47,5 +54,12 @@ cmake_push_check_state(RESET)
4754
char *p = strerror_r (0, buf, sizeof buf);
4855
return !p || x;
4956
}
50-
]] STRERROR_R_CHAR_P)
57+
]] PHP_ZEND_HAS_STRERROR_R_CHAR_P)
5158
cmake_pop_check_state()
59+
60+
if(PHP_ZEND_HAS_STRERROR_R_CHAR_P)
61+
set(STRERROR_R_CHAR_P TRUE)
62+
message(CHECK_PASS "char *")
63+
else()
64+
message(CHECK_PASS "int")
65+
endif()

cmake/Zend/cmake/Fibers.cmake

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
#[=============================================================================[
2-
# Fibers
3-
42
Check if Fibers can be used.
53
64
This module adds Boost fiber assembly files support if available for the
75
platform, otherwise it checks if ucontext can be used.
86
9-
## Control variables
10-
11-
* `ZEND_FIBER_ASM`
12-
13-
Whether to use Boost fiber assembly files.
7+
Control variables:
148
15-
## Cache variables
9+
* ZEND_FIBER_ASM - Whether to use Boost fiber assembly files.
1610
17-
* `ZEND_FIBER_UCONTEXT`
11+
Cache variables:
1812
19-
Whether `<ucontext.h>` header file is available and should be used.
13+
* ZEND_FIBER_UCONTEXT - Whether <ucontext.h> header file is available and should
14+
be used.
2015
21-
## Interface library
16+
Interface library:
2217
23-
* `Zend::Fibers`
18+
* Zend::Fibers
2419
2520
Interface library using Boost fiber assembly files and compile options if
2621
available.
27-
28-
## Usage
29-
30-
```cmake
31-
# CMakeLists.txt
32-
include(cmake/Fibers.cmake)
33-
```
3422
#]=============================================================================]
3523

3624
include_guard(GLOBAL)

cmake/Zend/cmake/MaxExecutionTimers.cmake

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
11
#[=============================================================================[
2-
# MaxExecutionTimers
3-
42
Check whether to enable Zend max execution timers.
53
6-
## Cache variables
7-
8-
* `ZEND_MAX_EXECUTION_TIMERS`
9-
10-
* `HAVE_TIMER_CREATE`
4+
Cache variables:
115
12-
Whether the system has `timer_create()`.
6+
* ZEND_MAX_EXECUTION_TIMERS
7+
* HAVE_TIMER_CREATE - Whether the system has timer_create().
138
14-
## Result variables
9+
Result variables:
1510
16-
* `ZEND_MAX_EXECUTION_TIMERS`
11+
* ZEND_MAX_EXECUTION_TIMERS
1712
1813
A local variable based on the cache variable and thread safety to be able to
19-
run consecutive configuration phases. When `ZEND_MAX_EXECUTION_TIMERS` cache
14+
run consecutive configuration phases. When ZEND_MAX_EXECUTION_TIMERS cache
2015
variable is set to 'auto', local variable default value is set to the
21-
`PHP_THREAD_SAFETY` value.
16+
value of PHP_THREAD_SAFETY variable.
2217
23-
## INTERFACE IMPORTED library
18+
Interface imported target:
2419
25-
* `Zend::MaxExecutionTimers`
20+
* Zend::MaxExecutionTimers
2621
27-
Includes possible additional library to be linked for using `timer_create()`
22+
Includes possible additional library to be linked for using timer_create()
2823
and a compile definition.
29-
30-
## Usage
31-
32-
```cmake
33-
# CMakeLists.txt
34-
include(cmake/MaxExecutionTimers.cmake)
35-
```
3624
#]=============================================================================]
3725

3826
include_guard(GLOBAL)

cmake/Zend/cmake/Version.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Set Zend Engine version variables from the php-src/Zend/*.h header files.
33
44
Variables:
55
6-
* `Zend_VERSION_EXTENSION_API_NO`
7-
* `Zend_VERSION_LABEL`
8-
* `Zend_VERSION_MODULE_API_NO`
9-
* `Zend_VERSION`
6+
* Zend_VERSION_EXTENSION_API_NO
7+
* Zend_VERSION_LABEL
8+
* Zend_VERSION_MODULE_API_NO
9+
* Zend_VERSION
1010
#]=============================================================================]
1111

1212
include_guard(GLOBAL)

cmake/cmake/checks/CheckSegmentsAlignment.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ message(
2727

2828
if(
2929
NOT CMAKE_SYSTEM_NAME STREQUAL "Linux"
30-
AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3456]86.*|x86_64)$"
30+
OR NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3456]86.*|x86_64)$"
3131
)
3232
message(CHECK_FAIL "no")
3333
return()

0 commit comments

Comments
 (0)