Skip to contentSkip to conversation

Upgrade php versions and enable opcache

PATCH New Anuj Mittal 1 participant 6 messages Apr 3, 2018

lore
Share & tools
lore
#0 lore raw

cover Upgrade php versions and enable opcache

These patches upgrade the versions of php recipes and enable opcache in both. I had to move around some patches to ensure both the versions compile without any fuzz warnings.

There are still some unrelated issues with these recipes like the ini file not getting installed and the do_install logic should perhaps be reviewed again.

Anuj Mittal (5):
php: move patches to a single directory
php7: upgrade to 7.2.4
php5: upgrade to 5.6.35
php: add opcache extension to PACKAGECONFIG
php: enable opcache by default

 .../php-7.1.9/0001-Specify-tag-with-libtool.patch  |   62 -
 .../php/php-7.1.9/CVE-2017-16642.patch             | 5241 --------------------
 .../php/php-7.1.9/CVE-2018-5711.patch              |   56 -
 meta-oe/recipes-devtools/php/php.inc               |   23 +-
 .../0001-Add-lpthread-to-link.patch                |    0
 ...-acinclude.m4-don-t-unset-cache-variables.patch |   39 +
 ...nclude.m4-skip-binconfig-check-for-libxml.patch |   56 +
 ...i.c-build-empty-php_load_zend_extension_c.patch |   63 +
 .../0001-opcache-config.m4-enable-opcache.patch    |  385 ++
 .../change-AC_TRY_RUN-to-AC_TRY_LINK.patch         |   13 +-
 meta-oe/recipes-devtools/php/php/configure.patch   |   11 -
 meta-oe/recipes-devtools/php/php/iconv.patch       |   19 +-
 .../php/php/imap-fix-autofoo.patch                 |   19 +-
 .../recipes-devtools/php/php/pear-makefile.patch   |   18 +-
 .../recipes-devtools/php/php/phar-makefile.patch   |   15 +-
 ...hp5-0001-opcache-config.m4-enable-opcache.patch |  387 ++
 .../php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch}   |   11 +-
 ...ear-makefile.patch => php5-pear-makefile.patch} |   12 +-
 ...har-makefile.patch => php5-phar-makefile.patch} |   15 +-
 .../recipes-devtools/php/php/php_exec_native.patch |   16 +-
 meta-oe/recipes-devtools/php/php_5.6.33.bb         |   10 -
 meta-oe/recipes-devtools/php/php_5.6.35.bb         |   23 +
 meta-oe/recipes-devtools/php/php_7.1.9.bb          |   18 -
 meta-oe/recipes-devtools/php/php_7.2.4.bb          |   23 +
 24 files changed, 1084 insertions(+), 5451 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/php/php-7.1.9/0001-Specify-tag-with-libtool.patch
 delete mode 100644 meta-oe/recipes-devtools/php/php-7.1.9/CVE-2017-16642.patch
 delete mode 100644 meta-oe/recipes-devtools/php/php-7.1.9/CVE-2018-5711.patch
 rename meta-oe/recipes-devtools/php/{php-5.6.33 => php}/0001-Add-lpthread-to-link.patch (100%)
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch
 rename meta-oe/recipes-devtools/php/{php-7.1.9 => php}/change-AC_TRY_RUN-to-AC_TRY_LINK.patch (75%)
 delete mode 100644 meta-oe/recipes-devtools/php/php/configure.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch
 rename meta-oe/recipes-devtools/php/{php-5.6.33/change-AC_TRY_RUN-to-AC_TRY_LINK.patch => php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch} (78%)
 copy meta-oe/recipes-devtools/php/php/{pear-makefile.patch => php5-pear-makefile.patch} (66%)
 copy meta-oe/recipes-devtools/php/php/{phar-makefile.patch => php5-phar-makefile.patch} (79%)
 delete mode 100644 meta-oe/recipes-devtools/php/php_5.6.33.bb
 create mode 100644 meta-oe/recipes-devtools/php/php_5.6.35.bb
 delete mode 100644 meta-oe/recipes-devtools/php/php_7.1.9.bb
 create mode 100644 meta-oe/recipes-devtools/php/php_7.2.4.bb
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/5 php: move patches to a single directory

Having two directories with version numbers just leads to unnecessary churn everytime there's a version update.

We can have all patches in one single directory and differentiate b/w specific version by prefix php5-/php7-

---
 .../change-AC_TRY_RUN-to-AC_TRY_LINK.patch         | 56 ----------------------
 .../0001-Add-lpthread-to-link.patch                |  0
 .../0001-Specify-tag-with-libtool.patch            |  0
 .../php/{php-7.1.9 => php}/CVE-2017-16642.patch    |  0
 .../php/{php-7.1.9 => php}/CVE-2018-5711.patch     |  0
 .../change-AC_TRY_RUN-to-AC_TRY_LINK.patch         |  0
 6 files changed, 56 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/php/php-5.6.33/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
 rename meta-oe/recipes-devtools/php/{php-5.6.33 => php}/0001-Add-lpthread-to-link.patch (100%)
 rename meta-oe/recipes-devtools/php/{php-7.1.9 => php}/0001-Specify-tag-with-libtool.patch (100%)
 rename meta-oe/recipes-devtools/php/{php-7.1.9 => php}/CVE-2017-16642.patch (100%)
 rename meta-oe/recipes-devtools/php/{php-7.1.9 => php}/CVE-2018-5711.patch (100%)
 rename meta-oe/recipes-devtools/php/{php-7.1.9 => php}/change-AC_TRY_RUN-to-AC_TRY_LINK.patch (100%)
meta-oe/recipes-devtools/php/php-5.6.33/change-AC_TRY_RUN-to-AC_TRY_LINK.patch deleted +0 -56
deleted file mode 100644
index 39c334f..0000000
@@ -1,56 +0,0 @@
-[PATCH] config.m4: change AC_TRY_RUN to AC_TRY_LINK
-
-Upstream-Status: Pending
-
-AC_TRY_RUN is not suitable for cross-compile
-
-Signed-off-by: Roy Li <[email protected]>
----
- ext/fileinfo/config.m4 | 31 ++++++-------------------------
- 1 file changed, 6 insertions(+), 25 deletions(-)
-
-diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4
-index 7e98d62..8a8ea0e 100644
---- a/ext/fileinfo/config.m4
-+++ b/ext/fileinfo/config.m4
-@@ -14,31 +14,12 @@ if test "$PHP_FILEINFO" != "no"; then
-     libmagic/readcdf.c libmagic/softmagic.c"
- 
-   AC_MSG_CHECKING([for strcasestr])
--  AC_TRY_RUN([
--#include <string.h>
--#include <strings.h>
--#include <stdlib.h>
--
--int main(void)
--{
--        char *s0, *s1, *ret;
--
--        s0 = (char *) malloc(42);
--        s1 = (char *) malloc(8);
--
--        memset(s0, 'X', 42);
--        s0[24] = 'Y';
--        s0[26] = 'Z';
--        s0[41] = '\0';
--        memset(s1, 'x', 8);
--        s1[0] = 'y';
--        s1[2] = 'Z';
--        s1[7] = '\0';
--
--        ret = strcasestr(s0, s1);
--
--        return !(NULL != ret);
--}
-+  AC_TRY_COMPILE([
-+     #include <string.h>
-+     #include <strings.h>
-+     #include <stdlib.h>
-+  ],[
-+     strcasestr(NULL, NULL);
-   ],[
-     dnl using the platform implementation
-     AC_MSG_RESULT(yes)
--- 
-1.9.1
-
meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch renamed from meta-oe/recipes-devtools/php/php-5.6.33/0001-Add-lpthread-to-link.patch +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/php/php-5.6.33/0001-Add-lpthread-to-link.patch
rename to meta-oe/recipes-devtools/php/php/0001-Add-lpthread-to-link.patch
meta-oe/recipes-devtools/php/php/0001-Specify-tag-with-libtool.patch renamed from meta-oe/recipes-devtools/php/php-7.1.9/0001-Specify-tag-with-libtool.patch +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/php/php-7.1.9/0001-Specify-tag-with-libtool.patch
rename to meta-oe/recipes-devtools/php/php/0001-Specify-tag-with-libtool.patch
meta-oe/recipes-devtools/php/php/CVE-2017-16642.patch renamed from meta-oe/recipes-devtools/php/php-7.1.9/CVE-2017-16642.patch +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/php/php-7.1.9/CVE-2017-16642.patch
rename to meta-oe/recipes-devtools/php/php/CVE-2017-16642.patch
meta-oe/recipes-devtools/php/php/CVE-2018-5711.patch renamed from meta-oe/recipes-devtools/php/php-7.1.9/CVE-2018-5711.patch +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/php/php-7.1.9/CVE-2018-5711.patch
rename to meta-oe/recipes-devtools/php/php/CVE-2018-5711.patch
meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch renamed from meta-oe/recipes-devtools/php/php-7.1.9/change-AC_TRY_RUN-to-AC_TRY_LINK.patch +0 -0
similarity index 100%
rename from meta-oe/recipes-devtools/php/php-7.1.9/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
rename to meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/5 php7: upgrade to 7.2.4

In reply to Anuj Mittal

* For changes, see:
http://www.php.net/ChangeLog-7.php#7.2.4

* Remove patches as they've been upstreamed:
- 0001-Specify-tag-with-libtool.patch
- CVE-2017-16642.patch
- CVE-2018-5711.patch

* mcrypt module has been deprecated and as such dependency has been moved from php.inc to php5 recipe.

* Refresh patches to avoid fuzz warnings.

* New patches to:
- Make sure libxml is detected using pkg-config instead of binconfig.
- Fix link time warnings (backport, see patch for details)

* Move the following patches to php5 from inc as they were getting applied out of context:
- acinclude-xml2-config.patch
- 0001-acinclude-use-pkgconfig-for-libxml2-config.patch

License-Update: License is same, just a change in copyright year to 2018.

---
 meta-oe/recipes-devtools/php/php.inc               |    5 +-
 .../php/php/0001-Specify-tag-with-libtool.patch    |   62 -
 ...nclude.m4-skip-binconfig-check-for-libxml.patch |   56 +
 ...i.c-build-empty-php_load_zend_extension_c.patch |   63 +
 .../recipes-devtools/php/php/CVE-2017-16642.patch  | 5241 --------------------
 .../recipes-devtools/php/php/CVE-2018-5711.patch   |   56 -
 .../php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch |   13 +-
 meta-oe/recipes-devtools/php/php/configure.patch   |   20 +-
 meta-oe/recipes-devtools/php/php/iconv.patch       |   19 +-
 .../php/php/imap-fix-autofoo.patch                 |   19 +-
 .../recipes-devtools/php/php/pear-makefile.patch   |   18 +-
 .../recipes-devtools/php/php/phar-makefile.patch   |   15 +-
 .../recipes-devtools/php/php/php_exec_native.patch |   16 +-
 meta-oe/recipes-devtools/php/php_5.6.33.bb         |    8 +-
 .../php/{php_7.1.9.bb => php_7.2.4.bb}             |   12 +-
 15 files changed, 213 insertions(+), 5410 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/php/php/0001-Specify-tag-with-libtool.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch
 delete mode 100644 meta-oe/recipes-devtools/php/php/CVE-2017-16642.patch
 delete mode 100644 meta-oe/recipes-devtools/php/php/CVE-2018-5711.patch
 rename meta-oe/recipes-devtools/php/{php_7.1.9.bb => php_7.2.4.bb} (52%)
meta-oe/recipes-devtools/php/php.inc +1 -4
index 8394c4f..d2af4f6 100644
@@ -6,15 +6,13 @@ LICENSE = "PHP-3.0"
 
 BBCLASSEXTEND = "native"
 DEPENDS = "zlib bzip2 libxml2 virtual/libiconv php-native lemon-native \
-           openssl libmcrypt"
+           openssl"
 DEPENDS_class-native = "zlib-native libxml2-native"
 
 PHP_MAJOR_VERSION = "${@d.getVar('PV', True).split('.')[0]}"
 
 SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
-           file://acinclude-xml2-config.patch \
            file://0001-php-don-t-use-broken-wrapper-for-mkdir.patch \
-           file://0001-acinclude-use-pkgconfig-for-libxml2-config.patch \
           "
 
 SRC_URI_append_class-target = " \
@@ -57,7 +55,6 @@ EXTRA_OECONF = "--enable-mbstring \
                 --with-gettext=${STAGING_LIBDIR}/.. \
                 --with-zlib=${STAGING_LIBDIR}/.. \
                 --with-iconv=${STAGING_LIBDIR}/.. \
-                --with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \
                 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
                 --with-config-file-path=${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} \
                 ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \
meta-oe/recipes-devtools/php/php/0001-Specify-tag-with-libtool.patch deleted +0 -62

62 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/0001-acinclude.m4-skip-binconfig-check-for-libxml.patch new file +56 -0

56 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch new file +63 -0

63 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/CVE-2017-16642.patch deleted +0 -5241

2,796 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/CVE-2018-5711.patch deleted +0 -56

56 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/change-AC_TRY_RUN-to-AC_TRY_LINK.patch +9 -4
index 39c334f..3e90184 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php/configure.patch +15 -5
index c5334c7..d9d913f 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php/iconv.patch +12 -7
index 255fbb0..b6e3ceb 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php/imap-fix-autofoo.patch +12 -7
index da04c2d..b5fb7d4 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php/pear-makefile.patch +11 -7
index 9927d2d..4bc1025 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php/phar-makefile.patch +11 -4
index 2f7fe34..336cf0d 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php/php_exec_native.patch +10 -6
index 0506bdd..6af0dc8 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php_5.6.33.bb +7 -1
index cf31238..9c78918 100644

Lines of this file are not shown. View the raw message.

meta-oe/recipes-devtools/php/php_7.2.4.bb renamed from meta-oe/recipes-devtools/php/php_7.1.9.bb +6 -6
similarity index 52%
rename from meta-oe/recipes-devtools/php/php_7.1.9.bb
rename to meta-oe/recipes-devtools/php/php_7.2.4.bb
index 1d9e35a..e00e1b5 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 3/5 php5: upgrade to 5.6.35

In reply to Anuj Mittal

For changes, see:
http://php.net/ChangeLog-5.php#5.6.35

Split patches between php5 and php7 to ensure there are no fuzz warnings for both the versions.

---
 meta-oe/recipes-devtools/php/php.inc               |  2 -
 .../php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch    | 63 ++++++++++++++++++++++
 .../php/php/php5-pear-makefile.patch               | 26 +++++++++
 .../php/php/php5-phar-makefile.patch               | 46 ++++++++++++++++
 .../php/{php_5.6.33.bb => php_5.6.35.bb}           | 12 +++--
 meta-oe/recipes-devtools/php/php_7.2.4.bb          |  4 ++
 6 files changed, 148 insertions(+), 5 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch
 rename meta-oe/recipes-devtools/php/{php_5.6.33.bb => php_5.6.35.bb} (52%)
meta-oe/recipes-devtools/php/php.inc +0 -2
index d2af4f6..fbc750d 100644
@@ -18,8 +18,6 @@ SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
 SRC_URI_append_class-target = " \
             file://iconv.patch \
             file://imap-fix-autofoo.patch \
-            file://pear-makefile.patch \
-            file://phar-makefile.patch \
             file://php_exec_native.patch \
             file://php-fpm.conf \
             file://php-fpm-apache.conf \
meta-oe/recipes-devtools/php/php/php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch new file +63 -0

63 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/php5-pear-makefile.patch new file +26 -0
new file mode 100644
index 0000000..cff6426
@@ -0,0 +1,26 @@
+From 79725e82d5981fc94eb657f0f46a499dbfc1cc40 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <[email protected]>
+Date: Wed, 2 Nov 2011 16:54:57 +0100
+Subject: [PATCH] Upstream-status: Unknown
+
+%% original patch: php5-pear-makefile.patch
+---
+ pear/Makefile.frag | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pear/Makefile.frag b/pear/Makefile.frag
+index 00bacae..739eeca 100644
+--- a/pear/Makefile.frag
++++ b/pear/Makefile.frag
+@@ -11,7 +11,7 @@ PEAR_PREFIX = -dp a${program_prefix}
+ PEAR_SUFFIX = -ds a$(program_suffix)
+ 
+ install-pear-installer: $(SAPI_CLI_PATH)
+-	@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
++	@$(PHP_NATIVE_DIR)/php $(PEAR_INSTALL_FLAGS) $(builddir)/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX}
+ 
+ install-pear:
+ 	@echo "Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/"
+-- 
+2.7.4
+
meta-oe/recipes-devtools/php/php/php5-phar-makefile.patch new file +46 -0

46 lines not on this page · raw message

meta-oe/recipes-devtools/php/php_5.6.35.bb renamed from meta-oe/recipes-devtools/php/php_5.6.33.bb +9 -3
similarity index 52%
rename from meta-oe/recipes-devtools/php/php_5.6.33.bb
rename to meta-oe/recipes-devtools/php/php_5.6.35.bb
index 9c78918..5ccbfa1 100644
@@ -2,14 +2,20 @@ require php.inc
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b602636d46a61c0ac0432bbf5c078fe4"
 
-SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
+SRC_URI += "file://php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
             file://pthread-check-threads-m4.patch \
             file://0001-Add-lpthread-to-link.patch \
             file://acinclude-xml2-config.patch \
             file://0001-acinclude-use-pkgconfig-for-libxml2-config.patch \
             "
-SRC_URI[md5sum] = "1ba84d9881521065f6398e665786f9e2"
-SRC_URI[sha256sum] = "07f696a9761dcd839e2045c95c3a4d2ffb52c54417477cca9d30a14975b831cc"
+
+SRC_URI_append_class-target = " \
+                                file://php5-pear-makefile.patch \
+                                file://php5-phar-makefile.patch \
+                                "
+
+SRC_URI[md5sum] = "905ae5f586351f3ca29d044c9484d475"
+SRC_URI[sha256sum] = "ee78a7e9ca21d8ea394d037c55effff477a49dbae31c7753c547036f5bd73b92"
 
 DEPENDS += "libmcrypt"
 EXTRA_OECONF += "--with-mcrypt=${STAGING_DIR_TARGET}${exec_prefix} \
meta-oe/recipes-devtools/php/php_7.2.4.bb +4 -0
index e00e1b5..1a9c8ff 100644
@@ -6,6 +6,10 @@ SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
             file://0001-acinclude.m4-skip-binconfig-check-for-libxml.patch \
             file://0001-main-php_ini.c-build-empty-php_load_zend_extension_c.patch \
            "
+SRC_URI_append_class-target = " \
+                                file://pear-makefile.patch \
+                                file://phar-makefile.patch \
+                                "
 
 SRC_URI[md5sum] = "864c64ffd2f1686b035ef8ce6a6d8478"
 SRC_URI[sha256sum] = "11658a0d764dc94023b9fb60d4b5eb75d438ad17981efe70abb0d0d09a447ef3"
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/5 php: add opcache extension to PACKAGECONFIG

In reply to Anuj Mittal

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request [1].

Add an option to enable opcache in php. AC_CHECK_FUNC isn't suitable for a cross-compile environment, so pass the configure options instead to force dlopen detection that is necessary to have extension support enabled.

On a standard phpbench test, I see a performance improvement of > 40%.

[1] http://php.net/manual/en/book.opcache.php

---
 meta-oe/recipes-devtools/php/php.inc               |  14 +-
 ...-acinclude.m4-don-t-unset-cache-variables.patch |  39 +++
 .../0001-opcache-config.m4-enable-opcache.patch    | 385 ++++++++++++++++++++
 meta-oe/recipes-devtools/php/php/configure.patch   |  21 --
 ...hp5-0001-opcache-config.m4-enable-opcache.patch | 387 +++++++++++++++++++++
 meta-oe/recipes-devtools/php/php_5.6.35.bb         |   1 +
 meta-oe/recipes-devtools/php/php_7.2.4.bb          |   1 +
 7 files changed, 822 insertions(+), 26 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch
 delete mode 100644 meta-oe/recipes-devtools/php/php/configure.patch
 create mode 100644 meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch
meta-oe/recipes-devtools/php/php.inc +9 -5
index fbc750d..8ba218c 100644
@@ -21,7 +21,7 @@ SRC_URI_append_class-target = " \
             file://php_exec_native.patch \
             file://php-fpm.conf \
             file://php-fpm-apache.conf \
-            file://configure.patch \
+            file://0001-acinclude.m4-don-t-unset-cache-variables.patch \
             file://70_mod_php${PHP_MAJOR_VERSION}.conf \
             file://php-fpm.service \
           "
@@ -40,7 +40,6 @@ PHP_LIBDIR = "${libdir}/php${PHP_MAJOR_VERSION}"
 COMMON_EXTRA_OECONF = "--enable-sockets \
                        --enable-pcntl \
                        --enable-shared \
-                       --disable-opcache \
                        --disable-rpath \
                        --with-pic \
                        --libdir=${PHP_LIBDIR} \
@@ -59,6 +58,9 @@ EXTRA_OECONF = "--enable-mbstring \
                 ${@bb.utils.contains('PACKAGECONFIG', 'pam', '', 'ac_cv_lib_pam_pam_start=no', d)} \
                 ${COMMON_EXTRA_OECONF} \
 "
+
+CACHED_CONFIGUREVARS += "ac_cv_func_dlopen=yes ac_cv_lib_dl_dlopen=yes"
+
 EXTRA_OECONF_class-native = " \
                 --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \
                 --without-iconv \
@@ -89,7 +91,7 @@ PACKAGECONFIG[imap] = "--with-imap=${STAGING_DIR_HOST} \
                        ,--without-imap --without-imap-ssl \
                        ,uw-imap"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
-
+PACKAGECONFIG[opcache] = ",--disable-opcache"
 
 export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}"
 export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php"
@@ -196,14 +198,14 @@ php_sysroot_preprocess () {
 
 MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}"
 
-PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}"
+PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-opcache ${PN}"
 
 RDEPENDS_${PN} += "libgcc"
 RDEPENDS_${PN}-pear = "${PN}"
 RDEPENDS_${PN}-phar = "${PN}-cli"
 RDEPENDS_${PN}-cli = "${PN}"
 RDEPENDS_${PN}-modphp = "${PN} apache2"
-RDEPENDS_${PN}-dev = "${PN}"
+RDEPENDS_${PN}-opcache = "${PN}"
 
 INITSCRIPT_PACKAGES = "${PN}-fpm"
 inherit update-rc.d
@@ -232,6 +234,8 @@ FILES_${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \
                 ${bindir}/php-config ${PHP_LIBDIR}/php/.depdb \
                 ${PHP_LIBDIR}/php/.depdblock ${PHP_LIBDIR}/php/.filemap \
                 ${PHP_LIBDIR}/php/.lock ${PHP_LIBDIR}/php/test"
+FILES_${PN}-staticdev += "${PHP_LIBDIR}/extensions/*/*.a"
+FILES_${PN}-opcache = "${PHP_LIBDIR}/extensions/*/opcache${SOLIBSDEV}"
 FILES_${PN} = "${PHP_LIBDIR}/php"
 FILES_${PN} += "${bindir}"
 
meta-oe/recipes-devtools/php/php/0001-acinclude.m4-don-t-unset-cache-variables.patch new file +39 -0
new file mode 100644
index 0000000..a250cac
@@ -0,0 +1,39 @@
+From dfebe81f946a83fe2499fc84d4f3dbdc5612276c Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <[email protected]>
+Date: Tue, 3 Apr 2018 11:35:03 +0800
+Subject: [PATCH] acinclude.m4: don't unset cache variables
+
+Unsetting prevents cache variable from being passed to configure.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Anuj Mittal <[email protected]>
+---
+ acinclude.m4 | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index f6a55ec..d3346df 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1890,8 +1890,6 @@ define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,]))
+ dnl
+ AC_DEFUN([PHP_CHECK_FUNC_LIB],[
+   ifelse($2,,:,[
+-  unset ac_cv_lib_$2[]_$1
+-  unset ac_cv_lib_$2[]___$1
+   unset found
+   AC_CHECK_LIB($2, $1, [found=yes], [
+     AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
+@@ -1923,8 +1921,6 @@ dnl in the default libraries and as a fall back in the specified library.
+ dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.
+ dnl
+ AC_DEFUN([PHP_CHECK_FUNC],[
+-  unset ac_cv_func_$1
+-  unset ac_cv_func___$1
+   unset found
+   
+   AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
+-- 
+2.7.4
+
meta-oe/recipes-devtools/php/php/0001-opcache-config.m4-enable-opcache.patch new file +385 -0

385 lines not on this page · raw message

meta-oe/recipes-devtools/php/php/configure.patch deleted +0 -21
deleted file mode 100644
index d9d913f..0000000
@@ -1,21 +0,0 @@
-From 617d01ef2ac2f436cd8e06555b608db56079b851 Mon Sep 17 00:00:00 2001
-From: Paul Eggleton <[email protected]>
-Date: Tue, 17 Jul 2012 11:31:54 +0100
-
----
- configure | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/configure b/configure
-index 1f1ef32..392fb76 100755
---- a/configure
-+++ b/configure
-@@ -11642,8 +11642,6 @@ $as_echo "#define HAVE_LIBNSL 1" >>confdefs.h
- 
- 
- 
--  unset ac_cv_func_dlopen
--  unset ac_cv_func___dlopen
-   unset found
- 
-   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
meta-oe/recipes-devtools/php/php/php5-0001-opcache-config.m4-enable-opcache.patch new file +387 -0

387 lines not on this page · raw message

meta-oe/recipes-devtools/php/php_5.6.35.bb +1 -0
index 5ccbfa1..c17c0d6 100644
@@ -12,6 +12,7 @@ SRC_URI += "file://php5-change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
 SRC_URI_append_class-target = " \
                                 file://php5-pear-makefile.patch \
                                 file://php5-phar-makefile.patch \
+                                file://php5-0001-opcache-config.m4-enable-opcache.patch \
                                 "
 
 SRC_URI[md5sum] = "905ae5f586351f3ca29d044c9484d475"
meta-oe/recipes-devtools/php/php_7.2.4.bb +1 -0
index 1a9c8ff..04d9b16 100644
@@ -9,6 +9,7 @@ SRC_URI += "file://change-AC_TRY_RUN-to-AC_TRY_LINK.patch \
 SRC_URI_append_class-target = " \
                                 file://pear-makefile.patch \
                                 file://phar-makefile.patch \
+                                file://0001-opcache-config.m4-enable-opcache.patch \
                                 "
 
 SRC_URI[md5sum] = "864c64ffd2f1686b035ef8ce6a6d8478"
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/5 php: enable opcache by default

In reply to Anuj Mittal
---
 meta-oe/recipes-devtools/php/php.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-devtools/php/php.inc +1 -1
index 8ba218c..066b97c 100644
@@ -67,7 +67,7 @@ EXTRA_OECONF_class-native = " \
                 ${COMMON_EXTRA_OECONF} \
 "
 
-PACKAGECONFIG ??= "mysql sqlite3 imap \
+PACKAGECONFIG ??= "mysql sqlite3 imap opcache \
                    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
 "
 PACKAGECONFIG_class-native = ""
Signature · 1 line
2.7.4