From 0205cc50f3bad019b948ad8faef8bcc6e983f9ec Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 29 Aug 2024 14:22:02 -0500 Subject: [PATCH] Fixed various php compilation problems: - Modified php building for buggy old toolchains https://github.com/php/php-src/issues/12774 https://sourceware.org/bugzilla/show_bug.cgi?id=23169 - Patched php configure script for ubuntu-16 old gcc version 5 The check in php/build/php.m4 is not sufficient to guard for gcc 5 on ubuntu 16 Ticket: ENT-12140 Changelog: none. --- deps-packaging/php/cfbuild-php.spec | 3 ++- deps-packaging/php/debian/rules | 4 +++- .../php/old-gcc-check-avx512-better.patch | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 deps-packaging/php/old-gcc-check-avx512-better.patch diff --git a/deps-packaging/php/cfbuild-php.spec b/deps-packaging/php/cfbuild-php.spec index 975400e46..852dab41e 100644 --- a/deps-packaging/php/cfbuild-php.spec +++ b/deps-packaging/php/cfbuild-php.spec @@ -34,7 +34,7 @@ fi --with-iconv \ --with-zlib=%{prefix} \ --with-libmbfl=%{prefix} \ - --enable-mbstring \ + --enable-mbstring=shared,%{prefix} \ --enable-sockets \ --disable-mbregex \ --without-fpm-user \ @@ -125,6 +125,7 @@ sed -ri 's/^(\s|;)phar.readonly = On/phar.readonly = Off/' ${RPM_BUILD_ROOT}%{pr echo "extension=curl.so" >> ${RPM_BUILD_ROOT}%{prefix}/httpd/php/lib/curl.ini echo "extension=openssl.so" >>${RPM_BUILD_ROOT}%{prefix}/httpd/php/lib/openssl.ini +echo "extension=mbstring.so" >>${RPM_BUILD_ROOT}%{prefix}/httpd/php/lib/mbstring.ini rm -rf ${RPM_BUILD_ROOT}%{prefix}/httpd/conf rm -rf ${RPM_BUILD_ROOT}%{prefix}/httpd/php/lib/php/.channels rm -rf ${RPM_BUILD_ROOT}%{prefix}/httpd/php/lib/php/.depdb diff --git a/deps-packaging/php/debian/rules b/deps-packaging/php/debian/rules index 94eaf588d..f7a26b4e7 100755 --- a/deps-packaging/php/debian/rules +++ b/deps-packaging/php/debian/rules @@ -12,6 +12,7 @@ build: build-stamp build-stamp: dh_testdir + patch -p0 < $(CURDIR)/old-gcc-check-avx512-better.patch ./configure --prefix=$(PREFIX)/httpd/php \ --with-config-file-scan-dir=$(PREFIX)/httpd/php/lib \ --with-apxs2=$(PREFIX)/httpd/bin/apxs \ @@ -22,7 +23,7 @@ build-stamp: --with-iconv \ --with-zlib=$(PREFIX) \ --with-libmbfl=$(PREFIX) \ ---enable-mbstring \ +--enable-mbstring=shared,$(PREFIX) \ --enable-sockets \ --disable-mbregex \ --without-fpm-user \ @@ -116,6 +117,7 @@ install: build echo "extension=curl.so" >> $(CURDIR)/debian/tmp$(PREFIX)/httpd/php/lib/curl.ini echo "extension=openssl.so" >> $(CURDIR)/debian/tmp$(PREFIX)/httpd/php/lib/openssl.ini + echo "extension=mbstring.so" >> $(CURDIR)/debian/tmp$(PREFIX)/httpd/php/lib/mbstring.ini rm -rf $(CURDIR)/debian/tmp$(PREFIX)/httpd/conf diff --git a/deps-packaging/php/old-gcc-check-avx512-better.patch b/deps-packaging/php/old-gcc-check-avx512-better.patch new file mode 100644 index 000000000..c64294296 --- /dev/null +++ b/deps-packaging/php/old-gcc-check-avx512-better.patch @@ -0,0 +1,21 @@ +--- configure.old ++++ configure +@@ -18114,6 +18114,10 @@ printf %s "checking for avx512 supports in compiler... " >&6; } + #include + int main(void) { + __m512i mask = _mm512_set1_epi32(0x1); ++ __builtin_cpu_supports("avx512dq"); ++ __builtin_cpu_supports("avx512cd"); ++ __builtin_cpu_supports("avx512bw"); ++ __builtin_cpu_supports("avx512vl"); + char out[32]; + _mm512_storeu_si512(out, _mm512_shuffle_epi8(mask, mask)); + return 0; +@@ -18152,6 +18156,7 @@ printf %s "checking for avx512 vbmi supports in compiler... " >&6; } + + #include + int main(void) { ++ __builtin_cpu_supports("avx512vbmi"); + __m512i mask = _mm512_set1_epi32(0x1); + char out[32]; + _mm512_storeu_si512(out, _mm512_permutexvar_epi8(mask, mask));