Skip to content

Commit e7c6687

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 6e51651 + c9a5a73 commit e7c6687

29 files changed

+239
-84
lines changed

cmake/Zend/cmake/CheckGlobalRegisterVariables.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ See also: [GCC global register variables](https://gcc.gnu.org/onlinedocs/gcc/Glo
1616

1717
include_guard(GLOBAL)
1818

19+
# Skip in consecutive configuration phases.
20+
if(DEFINED HAVE_GCC_GLOBAL_REGS)
21+
return()
22+
endif()
23+
1924
include(CheckSourceCompiles)
2025
include(CMakePushCheckState)
2126

cmake/Zend/cmake/CheckStackDirection.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Check whether the stack grows downwards. Assumes contiguous stack.
1212

1313
include_guard(GLOBAL)
1414

15+
# Skip in consecutive configuration phases.
16+
if(DEFINED ZEND_CHECK_STACK_LIMIT)
17+
return()
18+
endif()
19+
1520
include(CheckSourceRuns)
1621
include(CMakePushCheckState)
1722

cmake/Zend/cmake/Fibers.cmake

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,32 @@ include(CMakePushCheckState)
3535
add_library(zend_fibers INTERFACE)
3636
add_library(Zend::Fibers ALIAS zend_fibers)
3737

38-
message(CHECK_START "Whether syscall to create shadow stack exists")
39-
cmake_push_check_state(RESET)
40-
set(CMAKE_REQUIRED_QUIET TRUE)
41-
42-
check_source_runs(C [[
43-
#include <unistd.h>
44-
#include <sys/mman.h>
45-
int main(void)
46-
{
47-
void* base = (void *)syscall(451, 0, 0x20000, 0x1);
48-
if (base != (void*)-1) {
49-
munmap(base, 0x20000);
50-
return 0;
38+
if(NOT DEFINED SHADOW_STACK_SYSCALL)
39+
message(CHECK_START "Whether syscall to create shadow stack exists")
40+
cmake_push_check_state(RESET)
41+
set(CMAKE_REQUIRED_QUIET TRUE)
42+
43+
check_source_runs(C [[
44+
#include <unistd.h>
45+
#include <sys/mman.h>
46+
int main(void)
47+
{
48+
void* base = (void *)syscall(451, 0, 0x20000, 0x1);
49+
if (base != (void*)-1) {
50+
munmap(base, 0x20000);
51+
return 0;
52+
}
53+
return 1;
5154
}
52-
return 1;
53-
}
54-
]] SHADOW_STACK_SYSCALL)
55-
cmake_pop_check_state()
56-
if(SHADOW_STACK_SYSCALL)
57-
message(CHECK_PASS "yes")
58-
else()
59-
# If the syscall doesn't exist, we may block the final ELF from
60-
# __PROPERTY_SHSTK via redefine macro as "-D__CET__=1".
61-
message(CHECK_FAIL "no")
55+
]] SHADOW_STACK_SYSCALL)
56+
cmake_pop_check_state()
57+
if(SHADOW_STACK_SYSCALL)
58+
message(CHECK_PASS "yes")
59+
else()
60+
# If the syscall doesn't exist, we may block the final ELF from
61+
# __PROPERTY_SHSTK via redefine macro as "-D__CET__=1".
62+
message(CHECK_FAIL "no")
63+
endif()
6264
endif()
6365

6466
block()

cmake/Zend/cmake/MaxExecutionTimers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check whether to enable Zend max execution timers.
1616
* `ZEND_MAX_EXECUTION_TIMERS`
1717
1818
A local variable based on the cache variable and thread safety to be able to
19-
run consecutive configuration runs. When `ZEND_MAX_EXECUTION_TIMERS` cache
19+
run consecutive configuration phases. When `ZEND_MAX_EXECUTION_TIMERS` cache
2020
variable is set to 'auto', local variable default value is set to the
2121
`PHP_THREAD_SAFETY` value.
2222

cmake/cmake/ConfigureChecks.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ cmake_pop_check_state()
136136
check_type_size("gid_t" SIZEOF_GID_T)
137137
if(NOT HAVE_SIZEOF_GID_T)
138138
set(
139-
gid_t int
140-
CACHE INTERNAL "Define as 'int' if <sys/types.h> doesn't define."
139+
gid_t
140+
int
141+
CACHE INTERNAL
142+
"Define as 'int' if not defined in <sys/types.h>."
141143
)
142144
endif()
143145

@@ -202,8 +204,10 @@ endif()
202204
check_type_size("uid_t" SIZEOF_UID_T)
203205
if(NOT HAVE_SIZEOF_UID_T)
204206
set(
205-
uid_t int
206-
CACHE INTERNAL "Define as 'int' if <sys/types.h> doesn't define."
207+
uid_t
208+
int
209+
CACHE INTERNAL
210+
"Define as 'int' if not defined in <sys/types.h>."
207211
)
208212
endif()
209213

@@ -434,9 +438,7 @@ endif()
434438
include(PHP/CheckByteOrder)
435439

436440
# Check for IPv6 support.
437-
if(PHP_IPV6)
438-
include(PHP/CheckIPv6)
439-
endif()
441+
include(PHP/CheckIPv6)
440442

441443
# Check how flush should be called.
442444
include(PHP/CheckFlushIo)

cmake/cmake/modules/FindACL.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ if(NOT DEFINED ACL_IS_BUILT_IN)
125125

126126
if(_acl_works)
127127
set(
128-
ACL_IS_BUILT_IN TRUE
129-
CACHE INTERNAL "Whether ACL is a part of the C library"
128+
ACL_IS_BUILT_IN
129+
TRUE
130+
CACHE INTERNAL
131+
"Whether ACL is a part of the C library."
130132
)
131133
else()
132134
set(ACL_IS_BUILT_IN FALSE)

cmake/cmake/modules/PHP/Bison.cmake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ function(php_bison name input output)
288288

289289
_php_bison_config()
290290

291+
# Skip consecutive find_package() calls when:
292+
# - project calls php_bison() multiple times and Bison will be downloaded
293+
# - the outer find_package() was called prior to php_bison()
294+
# - running consecutive configuration phases and Bison will be downloaded
291295
if(
292-
# Skip consecutive find_package() calls when:
293-
# - project calls php_bison() multiple times and Bison will be downloaded:
294296
NOT TARGET Bison::Bison
295-
# - the outer find_package() was called prior to php_bison():
296297
AND NOT DEFINED BISON_FOUND
297-
# - running consecutive configuration phases:
298-
AND NOT BISON_EXECUTABLE
298+
AND NOT _PHP_BISON_DOWNLOAD
299299
)
300300
find_package(BISON ${PHP_BISON_VERSION} ${quiet})
301301
endif()
@@ -650,5 +650,12 @@ function(_php_bison_download)
650650
get_property(packagesFound GLOBAL PROPERTY PACKAGES_FOUND)
651651
set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND BISON)
652652

653+
set(
654+
_PHP_BISON_DOWNLOAD
655+
TRUE
656+
CACHE INTERNAL
657+
"Internal marker whether the Bison will be downloaded."
658+
)
659+
653660
return(PROPAGATE BISON_FOUND BISON_VERSION)
654661
endfunction()

cmake/cmake/modules/PHP/CheckAVX512.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ TODO: Adjust checks for MSVC.
2020

2121
include_guard(GLOBAL)
2222

23+
# Skip in consecutive configuration phases.
24+
if(DEFINED PHP_HAVE_AVX512_SUPPORTS AND DEFINED PHP_HAVE_AVX512_VBMI_SUPPORTS)
25+
return()
26+
endif()
27+
2328
include(CheckSourceCompiles)
2429
include(CMakePushCheckState)
2530

cmake/cmake/modules/PHP/CheckAttribute.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ function(_php_check_attribute what attribute result)
103103
message(FATAL_ERROR "Wrong argument passed: ${what}")
104104
endif()
105105

106+
# Skip in consecutive configuration phases.
107+
if(DEFINED ${result})
108+
return()
109+
endif()
110+
106111
message(CHECK_START "Checking for ${what} attribute ${attribute}")
107112

108113
cmake_push_check_state(RESET)

cmake/cmake/modules/PHP/CheckBrokenGccStrlenOpt.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914
1515

1616
include_guard(GLOBAL)
1717

18+
# Skip in consecutive configuration phases.
19+
if(DEFINED PHP_HAVE_BROKEN_OPTIMIZE_STRLEN)
20+
return()
21+
endif()
22+
1823
include(CheckSourceRuns)
1924
include(CMakePushCheckState)
2025

0 commit comments

Comments
 (0)