Skip to content

Commit 25f1e6b

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 9122723 + 3472e9f commit 25f1e6b

File tree

6 files changed

+78
-106
lines changed

6 files changed

+78
-106
lines changed

bin/make-docs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ function generateDocs(
154154
'ext/posix/cmake',
155155
'ext/session/cmake',
156156
'ext/skeleton/cmake/modules/FindPHP.cmake',
157-
'ext/standard/cmake',
158157
'sapi/fpm/cmake',
159158
'sapi/phpdbg/cmake',
160159
'Zend/cmake',

cmake/ext/standard/CMakeLists.txt

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -283,41 +283,15 @@ endif()
283283
# Configuration checks.
284284
################################################################################
285285

286+
# Check for ARM CRC32 API.
287+
include(cmake/CheckArmCrc32.cmake)
288+
286289
# Check for fnmatch() implementation.
287290
include(cmake/CheckFnmatch.cmake)
288291

289292
# Check strptime().
290293
include(cmake/CheckStrptime.cmake)
291294

292-
# Check for aarch64 CRC32 API.
293-
message(CHECK_START "Checking for aarch64 CRC32 API availability")
294-
cmake_push_check_state(RESET)
295-
set(CMAKE_REQUIRED_QUIET TRUE)
296-
check_source_compiles(C [[
297-
#include <arm_acle.h>
298-
#if defined(__GNUC__)
299-
# if !defined(__clang__)
300-
# pragma GCC push_options
301-
# pragma GCC target ("+nothing+crc")
302-
# elif defined(__APPLE__)
303-
# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)
304-
# else
305-
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
306-
# endif
307-
#endif
308-
int main(void)
309-
{
310-
__crc32d(0, 0);
311-
return 0;
312-
}
313-
]] HAVE_AARCH64_CRC32)
314-
cmake_pop_check_state()
315-
if(HAVE_AARCH64_CRC32)
316-
message(CHECK_PASS "yes")
317-
else()
318-
message(CHECK_FAIL "no")
319-
endif()
320-
321295
# Check if there is a support means of creating a new process and defining which
322296
# handles it receives.
323297
message(CHECK_START "Checking if OS can spawn processes with inherited handles")
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#[=============================================================================[
2+
Check whether CRC32 API is supported on ARM architecture.
3+
4+
Result variables:
5+
6+
* HAVE_AARCH64_CRC32
7+
#]=============================================================================]
8+
9+
if(DEFINED PHP_EXT_STANDARD_HAS_ARM_CRC32)
10+
set(HAVE_AARCH64_CRC32 FALSE)
11+
12+
if(PHP_EXT_STANDARD_HAS_ARM_CRC32)
13+
set(HAVE_AARCH64_CRC32 TRUE)
14+
endif()
15+
16+
return()
17+
endif()
18+
19+
include(CheckSourceCompiles)
20+
include(CMakePushCheckState)
21+
22+
include_guard(GLOBAL)
23+
24+
function(_php_ext_standard_check_arm_crc32 result)
25+
message(CHECK_START "Checking for ARM CRC32 API availability")
26+
27+
set(${result} FALSE)
28+
29+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
30+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
31+
set(${result} TRUE)
32+
endif()
33+
34+
set(
35+
PHP_EXT_STANDARD_HAS_ARM_CRC32
36+
${${result}}
37+
CACHE INTERNAL
38+
"Whether ARM has CRC32."
39+
)
40+
endif()
41+
42+
cmake_push_check_state(RESET)
43+
set(CMAKE_REQUIRED_QUIET TRUE)
44+
45+
check_source_compiles(C [[
46+
#include <arm_acle.h>
47+
#ifdef __GNUC__
48+
# ifndef __clang__
49+
# pragma GCC push_options
50+
# pragma GCC target ("+nothing+crc")
51+
# elif defined(__APPLE__)
52+
# pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)
53+
# else
54+
# pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
55+
# endif
56+
#endif
57+
int main(void)
58+
{
59+
__crc32d(0, 0);
60+
return 0;
61+
}
62+
]] PHP_EXT_STANDARD_HAS_ARM_CRC32)
63+
cmake_pop_check_state()
64+
65+
if(PHP_EXT_STANDARD_HAS_ARM_CRC32)
66+
message(CHECK_PASS "yes")
67+
set(${result} TRUE)
68+
else()
69+
message(CHECK_FAIL "no")
70+
endif()
71+
72+
return(PROPAGATE ${result})
73+
endfunction()
74+
75+
_php_ext_standard_check_arm_crc32(HAVE_AARCH64_CRC32)

docs/cmake/modules/standard/CheckCrypt.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/cmake/modules/standard/CheckFnmatch.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/cmake/modules/standard/CheckStrptime.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)