Skip to content

Commit 3cd9333

Browse files
committed
Merge branch 'PHP-8.4'
2 parents d7142b2 + 88465e4 commit 3cd9333

38 files changed

+628
-807
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ cmake_dependent_option(
7878
)
7979
mark_as_advanced(ZEND_FIBER_ASM)
8080

81-
option(ZEND_GLOBAL_REGISTER_VARIABLES "Enable global register variables" ON)
82-
mark_as_advanced(ZEND_GLOBAL_REGISTER_VARIABLES)
83-
8481
cmake_dependent_option(
8582
ZEND_SIGNALS
8683
"Enable Zend signal handling"
@@ -468,14 +465,10 @@ php_search_libraries(
468465
include(cmake/CheckAsmGoto.cmake)
469466
include(cmake/CheckCpuidCount.cmake)
470467
include(cmake/CheckFloatPrecision.cmake)
471-
472-
if(ZEND_GLOBAL_REGISTER_VARIABLES)
473-
include(cmake/CheckGlobalRegisterVariables.cmake)
474-
endif()
475-
476468
include(cmake/CheckMMAlignment.cmake)
477469
include(cmake/CheckStackDirection.cmake)
478470
include(cmake/CheckStrerrorR.cmake)
471+
include(cmake/GlobalRegisterVariables.cmake)
479472

480473
################################################################################
481474
# Zend signals.
Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,45 @@
11
#[=============================================================================[
2-
Check whether the C compiler has support for the asm goto.
2+
Check whether the C compiler supports the inline assembly __asm__ goto.
33
44
Result variables:
55
66
* HAVE_ASM_GOTO
77
#]=============================================================================]
88

9-
include_guard(GLOBAL)
10-
119
include(CheckSourceCompiles)
1210
include(CMakePushCheckState)
1311

14-
set(HAVE_ASM_GOTO FALSE)
12+
# The check below otherwise passes on Windows but it is disabled in PHP.
13+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
14+
set(HAVE_ASM_GOTO FALSE)
15+
return()
16+
endif()
1517

1618
# Skip in consecutive configuration phases.
17-
if(DEFINED PHP_ZEND_HAS_ASM_GOTO)
19+
if(NOT DEFINED PHP_ZEND_HAS_ASM_GOTO)
20+
message(CHECK_START "Checking for the inline assembly __asm__ goto support")
21+
22+
cmake_push_check_state(RESET)
23+
set(CMAKE_REQUIRED_QUIET TRUE)
24+
check_source_compiles(C [[
25+
int main(void)
26+
{
27+
#if defined(__x86_64__) || defined(__i386__)
28+
__asm__ goto("jmp %l0\n" :::: end);
29+
#elif defined(__aarch64__)
30+
__asm__ goto("b %l0\n" :::: end);
31+
#endif
32+
end:
33+
return 0;
34+
}
35+
]] PHP_ZEND_HAS_ASM_GOTO)
36+
cmake_pop_check_state()
37+
1838
if(PHP_ZEND_HAS_ASM_GOTO)
19-
set(HAVE_ASM_GOTO TRUE)
39+
message(CHECK_PASS "yes")
40+
else()
41+
message(CHECK_FAIL "no")
2042
endif()
21-
return()
2243
endif()
2344

24-
# TODO: The check in this module otherwise passes on Windows. Should this be
25-
# enabled on Windows?
26-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
27-
return()
28-
endif()
29-
30-
message(CHECK_START "Checking for asm goto support")
31-
cmake_push_check_state(RESET)
32-
set(CMAKE_REQUIRED_QUIET TRUE)
33-
check_source_compiles(C [[
34-
int main(void)
35-
{
36-
#if defined(__x86_64__) || defined(__i386__)
37-
__asm__ goto("jmp %l0\n" :::: end);
38-
#elif defined(__aarch64__)
39-
__asm__ goto("b %l0\n" :::: end);
40-
#endif
41-
end:
42-
return 0;
43-
}
44-
]] PHP_ZEND_HAS_ASM_GOTO)
45-
cmake_pop_check_state()
46-
47-
if(PHP_ZEND_HAS_ASM_GOTO)
48-
set(HAVE_ASM_GOTO TRUE)
49-
message(CHECK_PASS "yes")
50-
else()
51-
message(CHECK_FAIL "no")
52-
endif()
45+
set(HAVE_ASM_GOTO ${PHP_ZEND_HAS_ASM_GOTO})

cmake/Zend/cmake/CheckCpuidCount.cmake

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,36 @@ Result variables:
66
* HAVE_CPUID_COUNT
77
#]=============================================================================]
88

9-
include_guard(GLOBAL)
10-
119
include(CheckSourceCompiles)
1210
include(CMakePushCheckState)
1311

14-
set(HAVE_CPUID_COUNT FALSE)
12+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
13+
set(HAVE_CPUID_COUNT FALSE)
14+
return()
15+
endif()
1516

1617
# Skip in consecutive configuration phases.
17-
if(DEFINED PHP_ZEND_HAS_CPUID_COUNT)
18+
if(NOT DEFINED PHP_ZEND_HAS_CPUID_COUNT)
19+
message(CHECK_START "Checking whether __cpuid_count is available")
20+
21+
cmake_push_check_state(RESET)
22+
set(CMAKE_REQUIRED_QUIET TRUE)
23+
check_source_compiles(C [[
24+
#include <cpuid.h>
25+
int main(void)
26+
{
27+
unsigned eax, ebx, ecx, edx;
28+
__cpuid_count(0, 0, eax, ebx, ecx, edx);
29+
return 0;
30+
}
31+
]] PHP_ZEND_HAS_CPUID_COUNT)
32+
cmake_pop_check_state()
33+
1834
if(PHP_ZEND_HAS_CPUID_COUNT)
19-
set(HAVE_CPUID_COUNT TRUE)
35+
message(CHECK_PASS "yes")
36+
else()
37+
message(CHECK_FAIL "no")
2038
endif()
21-
return()
2239
endif()
2340

24-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
25-
return()
26-
endif()
27-
28-
message(CHECK_START "Checking whether __cpuid_count is available")
29-
cmake_push_check_state(RESET)
30-
set(CMAKE_REQUIRED_QUIET TRUE)
31-
check_source_compiles(C [[
32-
#include <cpuid.h>
33-
int main(void)
34-
{
35-
unsigned eax, ebx, ecx, edx;
36-
__cpuid_count(0, 0, eax, ebx, ecx, edx);
37-
return 0;
38-
}
39-
]] PHP_ZEND_HAS_CPUID_COUNT)
40-
cmake_pop_check_state()
41-
42-
if(PHP_ZEND_HAS_CPUID_COUNT)
43-
set(HAVE_CPUID_COUNT TRUE)
44-
message(CHECK_PASS "yes")
45-
else()
46-
message(CHECK_FAIL "no")
47-
endif()
41+
set(HAVE_CPUID_COUNT ${PHP_ZEND_HAS_CPUID_COUNT})

0 commit comments

Comments
 (0)