Open m6w6 opened 1 month ago
I can reproduce when HAVE_MPROTECT
is not defined, because in this case sys/mman.h
is never included. This should be fixed by removing the #if defined(__linux__) && defined(HAVE_MEMFD_CREATE)
block and updating the condition here to include HAVE_MEMFD_CREATE
: https://github.com/php/php-src/blob/4a4371d31c44e02d5922f3179c063dfc1a3473ec/ext/opcache/zend_shared_alloc.c#L43
BTW, do you know why HAVE_MPROTECT
is not defined in your case?
Ah. I didn't notice there's another occurrence of this include. In that case, _GNU_SOURCE
might be missing.
This is odd because this is supposed to define it: https://github.com/php/php-src/blob/4a4371d31c44e02d5922f3179c063dfc1a3473ec/configure.ac#L122
Does https://github.com/php/php-src/pull/16570 fix the issue for you?
Description
_GNU_SOURCE
enabledsys/mman.h
is needed formemfd_create
andMFD_CLOEXEC
, yet the needed pre-processor instructions at the top ofzend_shared_alloc.c
are useless since they are wrapped withifdef HAVE_MEMFD_CREATE
, which is defined in a*config.h
not yet included.See https://github.com/php/php-src/blob/master/ext/opcache/zend_shared_alloc.c#L22-L27
As a consequence, the build failed for me on Ubuntu-24.04 with GCC-13.
PHP Version
master
Operating System
Ubuntu 24.04