Skip to content

Fix build of zend_shared_alloc.c when HAVE_MPROTECT is not defined #16570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: PHP-8.3
Choose a base branch
from

Conversation

arnaud-lb
Copy link
Member

@arnaud-lb arnaud-lb commented Oct 24, 2024

Fixes GH-16567

_GNU_SOURCE is always defined by the build system on Linux, so we can simply include sys/mman.h when HAVE_MEMFD_CREATE is defined.

@@ -40,7 +33,7 @@
# include <stdio.h>
#endif

#ifdef HAVE_MPROTECT
#if defined(HAVE_MPROTECT) || defined(HAVE_MEMFD_CREATE)
Copy link
Member

@devnexen devnexen Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was because we did not want to enable memfd_create for FreeBSD.
One possible approach would be to do something like here at configure time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

opcache/zend_shared_alloc.c: needed but ineffective pre-processor instructions
2 participants