From: Xinchen Hui Date: Sat, 17 Oct 2015 08:45:23 +0000 (-0700) Subject: Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10) X-Git-Tag: php-7.0.1RC1~233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4df6641c871e23478c3137365f682c38d8d95a3;p=php Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10) --- diff --git a/NEWS b/NEWS index 4d24e6accc..29bb0e41df 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ PHP NEWS . Fixed bug #70715 (Segmentation fault inside soap client). (Laruence) . Fixed bug #70709 (SOAP Client generates Segfault). (Laruence) +- Opcache: + . Fixed bug #70724 (Undefined Symbols from opcache.so on Mac OS X 10.10). + (Laruence) + - XSL: . Fixed bug #70678 (PHP7 returns true when false is expected). (Felipe) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index e6d7005a8b..14dce59f31 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2517,13 +2517,13 @@ static int accel_remap_huge_pages(void *start, size_t size, const char *name, si } memcpy(mem, start, size); -#ifdef MAP_HUGETLB +# ifdef MAP_HUGETLB ret = mmap(start, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED | MAP_HUGETLB, -1, 0); -#endif -#ifdef MADV_HUGEPAGE +# endif +# ifdef MADV_HUGEPAGE if (ret == MAP_FAILED) { ret = mmap(start, size, PROT_READ | PROT_WRITE | PROT_EXEC, @@ -2531,7 +2531,7 @@ static int accel_remap_huge_pages(void *start, size_t size, const char *name, si -1, 0); madvise(start, size, MADV_HUGEPAGE); } -#endif +# endif if (ret == start) { memcpy(start, mem, size); mprotect(start, size, PROT_READ | PROT_EXEC); @@ -2565,7 +2565,13 @@ static void accel_move_code_to_huge_pages(void) fclose(f); } } -# endif +# else +static void accel_move_code_to_huge_pages(void) +{ + zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": opcache.huge_code_pages has no affect as huge page is not supported"); + return; +} +# endif /* defined(MAP_HUGETLB) || defined(MADV_HUGEPAGE) */ #endif /* HAVE_HUGE_CODE_PAGES */ static int accel_startup(zend_extension *extension) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index bd53f6e373..f65e270000 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -242,7 +242,6 @@ static ZEND_INI_MH(OnEnable) } #ifdef HAVE_OPCACHE_FILE_CACHE - static ZEND_INI_MH(OnUpdateFileCache) { if (new_value) {