-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
add librt for opcache #4794
add librt for opcache #4794
Conversation
76324ea
to
78247eb
Compare
FYI On Fedora 29
On Fedora 31
|
78247eb
to
8c92b5c
Compare
During configure, -lrt is there (in For robustness, I also add |
ext/opcache/config.m4
Outdated
@@ -248,6 +252,9 @@ int main() { | |||
Optimizer/zend_dump.c, | |||
shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes) | |||
|
|||
PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)]) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be add -lrt in previous chunk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-lrt is necessary only with HAVE_SHM_MMAP_POSIX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, fixeed
@@ -13742,7 +13742,7 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) | |||
sljit_free_compiler(compiler); | |||
SLJIT_FREE(common->optimized_cbracket, allocator_data); | |||
SLJIT_FREE(common->private_data_ptrs, allocator_data); | |||
PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data); | |||
PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose, this and following changes are unrelated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.... rebase issue.... ignore this
8c92b5c
to
abf7ab0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any problems. If it works for you - merge.
Applied in 7.4+ |
to ensure opcache is always linked with librt
In some build case with have an
undefined symbol: shm_unlink
so we need to explicitly add this library.Notice: this only happens in Fedora >= 31 so with recent gcc 9.2 and glibc 2.30
In older versions (Fedora <= 30) PHP is linked against librt which is enough
In new version, this lib disappear (linker optimization because uneeded ?), so have to be added.
BTW the patch is incomplete, as we also need to build using
--enable-opcache=shared
didn't find the way to have proper default value = "shared" (there is some PHP_ALWARS_SHARED macro, but can't find it definition)