Skip to content

Commit e87450a

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents ccb33e9 + 9be4957 commit e87450a

14 files changed

+485
-242
lines changed

cmake/Zend/CMakeLists.txt

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

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

465+
include(cmake/CheckAsmGoto.cmake)
466+
include(cmake/CheckCpuidCount.cmake)
506467
include(cmake/CheckFloatPrecision.cmake)
507468

508469
if(ZEND_GLOBAL_REGISTER_VARIABLES)
@@ -540,9 +501,6 @@ add_feature_info(
540501
################################################################################
541502

542503
include(cmake/MaxExecutionTimers.cmake)
543-
if(TARGET Zend::MaxExecutionTimers)
544-
target_link_libraries(zend PUBLIC Zend::MaxExecutionTimers)
545-
endif()
546504

547505
################################################################################
548506
# Generate parser and lexer files.
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)