From a0610aa6810031604c794a65738494aaabc4a555 Mon Sep 17 00:00:00 2001 From: Remi Pommarel Date: Fri, 10 Sep 2021 00:30:34 +0200 Subject: [PATCH] php: Support opcache cross compilation Opcache extension configuration tries to detect some shared memory function by compiling and executing test programs at compile time. This cannot work when cross compiling. To workaround that add proper defines to use those functions anyway if we are cross compiling. That fixes the following error when using opcache extension on arm: Fatal Error Unable to allocate shared memory segment of 134217728 bytes --- srcpkgs/php/template | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/srcpkgs/php/template b/srcpkgs/php/template index a1390b7e1ec2..cc9569e878e9 100644 --- a/srcpkgs/php/template +++ b/srcpkgs/php/template @@ -23,7 +23,14 @@ replaces="php-mcrypt<7.2.0" if [ -n "$CROSS_BUILD" ]; then # php-pear needs php to build hostmakedepends+=" php" - CFLAGS+=" -DHAVE_LIBDL -DHAVE_DLOPEN -DHAVE_DLSYM" + CFLAGS+=" -DHAVE_LIBDL \ + -DHAVE_DLOPEN \ + -DHAVE_DLSYM + -DHAVE_SHM_IPC \ + -DHAVE_SHM_MMAP_ANON \ + -DHAVE_SHM_MMAP_ZERO \ + -DHAVE_SHM_MMAP_POSIX \ + -DHAVE_SHM_MMAP_FILE" fi do_build() {