Skip to content

Commit 797379e

Browse files
committed
Fix CS and remove ASM patches
The ASM patches are now removed. The 32-bit vs. 64-bit issue is happening only on Oracle Studio compiler, which is blacklisted in this build system anyway. Using a new CMAKE_<LANG>_COMPILER_ARCHTECTURE_ID CMake variable properly selects the asm/*.S files during the configuration now.
1 parent 87989f0 commit 797379e

File tree

9 files changed

+62
-1043
lines changed

9 files changed

+62
-1043
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ endif()
6969

7070
# Ignore build directory in Git repository.
7171
block()
72-
file(GLOB files "${CMAKE_CURRENT_BINARY_DIR}/*")
73-
if(files PATH_EQUAL ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
72+
file(GLOB path ${CMAKE_CURRENT_BINARY_DIR}/*)
73+
if(path PATH_EQUAL ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
7474
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/.gitignore "*\n")
7575
endif()
7676
endblock()

cmake/cmake/CMakeDefaults.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ endif()
2020

2121
# Ignore build directory in Git repository.
2222
block()
23-
file(GLOB files "${CMAKE_CURRENT_BINARY_DIR}/*")
24-
if(files PATH_EQUAL ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
23+
file(GLOB path ${CMAKE_CURRENT_BINARY_DIR}/*)
24+
if(path PATH_EQUAL ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles)
2525
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/.gitignore "*\n")
2626
endif()
2727
endblock()

cmake/cmake/ConfigureChecks.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ endif()
402402
set(HAVE_FDATASYNC ${PHP_HAVE_FDATASYNC})
403403

404404
block(PROPAGATE HAVE_FLOCK)
405+
set(headers "")
406+
405407
if(PHP_HAVE_FCNTL_H)
406408
list(APPEND headers "fcntl.h")
407409
endif()

cmake/cmake/modules/FindRE2C.cmake

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,42 +34,42 @@ find_package(RE2C)
3434
include(FeatureSummary)
3535
include(FindPackageHandleStandardArgs)
3636

37-
################################################################################
38-
# Configuration.
39-
################################################################################
40-
41-
set_package_properties(
42-
RE2C
43-
PROPERTIES
44-
URL "https://re2c.org/"
45-
DESCRIPTION "Lexer generator"
46-
)
47-
48-
################################################################################
49-
# Find the executable.
50-
################################################################################
51-
52-
set(_re2cRequiredVars RE2C_EXECUTABLE)
53-
set(_reason "")
54-
55-
find_program(
56-
RE2C_EXECUTABLE
57-
NAMES re2c
58-
DOC "The path to the re2c executable"
59-
)
60-
mark_as_advanced(RE2C_EXECUTABLE)
61-
62-
if(NOT RE2C_EXECUTABLE)
63-
string(APPEND _reason "The re2c command-line executable not found. ")
64-
endif()
65-
66-
################################################################################
67-
# Check version.
68-
################################################################################
69-
70-
block(PROPAGATE RE2C_VERSION _reason _re2cRequiredVars)
37+
block(PROPAGATE RE2C_FOUND RE2C_VERSION)
38+
##############################################################################
39+
# Configuration.
40+
##############################################################################
41+
42+
set_package_properties(
43+
RE2C
44+
PROPERTIES
45+
URL "https://re2c.org/"
46+
DESCRIPTION "Lexer generator"
47+
)
48+
49+
set(required_vars RE2C_EXECUTABLE)
50+
set(reason "")
51+
52+
##############################################################################
53+
# Find the executable.
54+
##############################################################################
55+
56+
find_program(
57+
RE2C_EXECUTABLE
58+
NAMES re2c
59+
DOC "The path to the re2c executable"
60+
)
61+
mark_as_advanced(RE2C_EXECUTABLE)
62+
63+
if(NOT RE2C_EXECUTABLE)
64+
string(APPEND reason "The re2c command-line executable not found. ")
65+
endif()
66+
67+
##############################################################################
68+
# Check version.
69+
##############################################################################
70+
7171
if(IS_EXECUTABLE "${RE2C_EXECUTABLE}")
72-
list(APPEND _re2cRequiredVars RE2C_VERSION)
72+
list(APPEND required_vars RE2C_VERSION)
7373
execute_process(
7474
COMMAND ${RE2C_EXECUTABLE} --version
7575
OUTPUT_VARIABLE version
@@ -79,22 +79,19 @@ block(PROPAGATE RE2C_VERSION _reason _re2cRequiredVars)
7979
)
8080

8181
if(NOT result EQUAL 0)
82-
string(APPEND _reason "Command '${RE2C_EXECUTABLE} --version' failed. ")
82+
string(APPEND reason "Command '${RE2C_EXECUTABLE} --version' failed. ")
8383
elseif(version MATCHES "^re2c ([0-9.]+[^\n]+)")
8484
set(RE2C_VERSION "${CMAKE_MATCH_1}")
8585
else()
86-
string(APPEND _reason "Invalid version format. ")
86+
string(APPEND reason "Invalid version format. ")
8787
endif()
8888
endif()
89-
endblock()
90-
91-
find_package_handle_standard_args(
92-
RE2C
93-
REQUIRED_VARS ${_re2cRequiredVars}
94-
VERSION_VAR RE2C_VERSION
95-
HANDLE_VERSION_RANGE
96-
REASON_FAILURE_MESSAGE "${_reason}"
97-
)
9889

99-
unset(_re2cRequiredVars)
100-
unset(_reason)
90+
find_package_handle_standard_args(
91+
RE2C
92+
REQUIRED_VARS ${required_vars}
93+
VERSION_VAR RE2C_VERSION
94+
HANDLE_VERSION_RANGE
95+
REASON_FAILURE_MESSAGE "${reason}"
96+
)
97+
endblock()

cmake/ext/hash/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
117117
else()
118118
block()
119119
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
120-
set(sha3Dir "sha3/generic32lc")
121-
target_sources(php_ext_hash PRIVATE ${sha3Dir}/KeccakP-1600-inplace32BI.c)
120+
set(sha3_dir "sha3/generic32lc")
121+
target_sources(
122+
php_ext_hash
123+
PRIVATE ${sha3_dir}/KeccakP-1600-inplace32BI.c
124+
)
122125

123126
# Add -Wno-implicit-fallthrough flag due to warnings on 32-bit builds.
124127
php_check_compiler_flag(
@@ -128,28 +131,27 @@ else()
128131
)
129132
if(PHP_HAS_WNO_IMPLICIT_FALLTHROUGH_C)
130133
set_property(
131-
SOURCE ${sha3Dir}/KeccakP-1600-inplace32BI.c
134+
SOURCE ${sha3_dir}/KeccakP-1600-inplace32BI.c
132135
APPEND
133136
PROPERTY
134137
COMPILE_OPTIONS -Wno-implicit-fallthrough
135138
)
136139
endif()
137140
else()
138-
set(sha3Dir "sha3/generic64lc")
139-
target_sources(php_ext_hash PRIVATE ${sha3Dir}/KeccakP-1600-opt64.c)
141+
set(sha3_dir "sha3/generic64lc")
142+
target_sources(php_ext_hash PRIVATE ${sha3_dir}/KeccakP-1600-opt64.c)
140143
endif()
141144

142145
target_sources(
143146
php_ext_hash
144147
PRIVATE
145-
${sha3Dir}/KeccakHash.c
146-
${sha3Dir}/KeccakSponge.c
148+
${sha3_dir}/KeccakHash.c
149+
${sha3_dir}/KeccakSponge.c
147150
)
148151

149152
target_include_directories(
150153
php_ext_hash
151-
PRIVATE
152-
${CMAKE_CURRENT_SOURCE_DIR}/${sha3Dir}
154+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${sha3_dir}
153155
)
154156
endblock()
155157

0 commit comments

Comments
 (0)