Skip to content

Commit 026f9ce

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 58aab51 + e87450a commit 026f9ce

21 files changed

+598
-298
lines changed

cmake/Zend/CMakeLists.txt

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -456,47 +456,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
456456
endif()
457457
endif()
458458

459-
message(CHECK_START "Checking for asm goto support")
460-
cmake_push_check_state(RESET)
461-
set(CMAKE_REQUIRED_QUIET TRUE)
462-
check_source_compiles(C [[
463-
int main(void)
464-
{
465-
#if defined(__x86_64__) || defined(__i386__)
466-
__asm__ goto("jmp %l0\n" :::: end);
467-
#elif defined(__aarch64__)
468-
__asm__ goto("b %l0\n" :::: end);
469-
#endif
470-
end:
471-
return 0;
472-
}
473-
]] HAVE_ASM_GOTO)
474-
cmake_pop_check_state()
475-
if(HAVE_ASM_GOTO)
476-
message(CHECK_PASS "yes")
477-
else()
478-
message(CHECK_FAIL "no")
479-
endif()
480-
481-
message(CHECK_START "Checking whether __cpuid_count is available")
482-
cmake_push_check_state(RESET)
483-
set(CMAKE_REQUIRED_QUIET TRUE)
484-
check_source_compiles(C [[
485-
#include <cpuid.h>
486-
int main(void)
487-
{
488-
unsigned eax, ebx, ecx, edx;
489-
__cpuid_count(0, 0, eax, ebx, ecx, edx);
490-
return 0;
491-
}
492-
]] HAVE_CPUID_COUNT)
493-
cmake_pop_check_state()
494-
if(HAVE_CPUID_COUNT)
495-
message(CHECK_PASS "yes")
496-
else()
497-
message(CHECK_FAIL "no")
498-
endif()
499-
500459
# Check for Solaris/illumos process mapping.
501460
php_search_libraries(
502461
Pgrab
@@ -505,6 +464,8 @@ php_search_libraries(
505464
TARGET zend PRIVATE
506465
)
507466

467+
include(cmake/CheckAsmGoto.cmake)
468+
include(cmake/CheckCpuidCount.cmake)
508469
include(cmake/CheckFloatPrecision.cmake)
509470

510471
if(ZEND_GLOBAL_REGISTER_VARIABLES)
@@ -542,9 +503,6 @@ add_feature_info(
542503
################################################################################
543504

544505
include(cmake/MaxExecutionTimers.cmake)
545-
if(TARGET Zend::MaxExecutionTimers)
546-
target_link_libraries(zend PUBLIC Zend::MaxExecutionTimers)
547-
endif()
548506

549507
################################################################################
550508
# Generate parser and lexer files.

cmake/Zend/cmake/CheckAsmGoto.cmake

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#[=============================================================================[
2+
Check whether the C compiler has support for the asm goto.
3+
4+
Result variables:
5+
6+
* HAVE_ASM_GOTO
7+
#]=============================================================================]
8+
9+
include_guard(GLOBAL)
10+
11+
include(CheckSourceCompiles)
12+
include(CMakePushCheckState)
13+
14+
set(HAVE_ASM_GOTO FALSE)
15+
16+
# Skip in consecutive configuration phases.
17+
if(DEFINED PHP_ZEND_HAS_ASM_GOTO)
18+
if(PHP_ZEND_HAS_ASM_GOTO)
19+
set(HAVE_ASM_GOTO TRUE)
20+
endif()
21+
return()
22+
endif()
23+
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()
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#[=============================================================================[
2+
Check for the __cpuid_count support.
3+
4+
Result variables:
5+
6+
* HAVE_CPUID_COUNT
7+
#]=============================================================================]
8+
9+
include_guard(GLOBAL)
10+
11+
include(CheckSourceCompiles)
12+
include(CMakePushCheckState)
13+
14+
set(HAVE_CPUID_COUNT FALSE)
15+
16+
# Skip in consecutive configuration phases.
17+
if(DEFINED PHP_ZEND_HAS_CPUID_COUNT)
18+
if(PHP_ZEND_HAS_CPUID_COUNT)
19+
set(HAVE_CPUID_COUNT TRUE)
20+
endif()
21+
return()
22+
endif()
23+
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()

0 commit comments

Comments
 (0)