Skip to content

Commit c2d5d7b

Browse files
Fix PHP 8.5+ ZTS segfault on CentOS 7 by disabling IFUNC resolvers
CentOS 7's glibc lacks __builtin_cpu_init() support, causing IFUNC resolvers to crash during dynamic linking when detecting AVX2 support. Disable IFUNC and use runtime function pointer initialization instead.
1 parent f77e780 commit c2d5d7b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dockerfiles/ci/centos/7/php.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ RUN bash -c 'set -eux; \
3939
--prefix=${PHP_INSTALL_DIR_ZTS} \
4040
--with-config-file-path=${PHP_INSTALL_DIR_ZTS} \
4141
--with-config-file-scan-dir=${PHP_INSTALL_DIR_ZTS}/conf.d \
42+
$(if [ "$(expr substr ${PHP_VERSION} 1 1)" -eq 8 ] && [ "$(expr substr ${PHP_VERSION} 3 1)" -ge 5 ]; then \
43+
echo "ax_cv_have_func_attribute_ifunc=no"; \
44+
fi) \
4245
&& make -j 2 \
4346
&& make install \
4447
&& cp .libs/libphp*.so ${PHP_INSTALL_DIR_ZTS}/lib/apache2handler-libphp.so \

0 commit comments

Comments
 (0)