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
This commit is contained in:
Remi Pommarel 2021-09-10 00:30:34 +02:00 committed by Érico Nogueira Rolim
parent ee97c9f14a
commit 2984425c32

View file

@ -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() {