Skip to contentSkip to conversation

php: bump to version 5.6.7

PATCH New Gustavo Zacarias 2 participants 8 messages Apr 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 php: bump to version 5.6.7

---
 package/php/php.hash | 2 +-
 package/php/php.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/php/php.hash +1 -1
index 0794db8..e5e42d2 100644
@@ -1,2 +1,2 @@
 # From http://php.net/downloads.php
-md5	692f9bc5649806f2053eee1e7323b7ea	php-5.5.23.tar.xz
+md5	4e04eb021de009981ed963f993a171c1	php-5.6.7.tar.xz
package/php/php.mk +1 -1
index 73ed494..ed842b0 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-PHP_VERSION = 5.5.23
+PHP_VERSION = 5.6.7
 PHP_SITE = http://www.php.net/distributions
 PHP_SOURCE = php-$(PHP_VERSION).tar.xz
 PHP_INSTALL_STAGING = YES
Signature · 1 line
2.0.5
#1 lore raw

PATCH 2/3 php: cleanup patches

Convert patches from pure configure ones to *.m4/configure.in cleanness. This allows us to AUTORECONF (well, not quite, but close). Even though upstream will probably not accept them it's the right way.

---
 package/php/0001-ditch-unset.patch     | 26 ++++++++++++++
 package/php/0001-no-iconv-search.patch | 65 ----------------------------------
 package/php/0002-dlopen.patch          | 25 -------------
 package/php/0002-no-iconv-search.patch | 55 ++++++++++++++++++++++++++++
 package/php/0003-disable-pharcmd.patch |  9 ++---
 package/php/php.mk                     |  7 ++++
 6 files changed, 93 insertions(+), 94 deletions(-)
 create mode 100644 package/php/0001-ditch-unset.patch
 delete mode 100644 package/php/0001-no-iconv-search.patch
 delete mode 100644 package/php/0002-dlopen.patch
 create mode 100644 package/php/0002-no-iconv-search.patch
package/php/0001-ditch-unset.patch new file +26 -0
new file mode 100644
index 0000000..b43b40f
@@ -0,0 +1,26 @@
+Unsetting ac_cv_{func,lib}_* is bad, you can't feed the configure cache.
+Terminate them with extreme prejudice.
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+
+diff -Nura php-5.6.7.orig/aclocal.m4 php-5.6.7/aclocal.m4
+--- php-5.6.7.orig/aclocal.m4	2015-04-08 11:08:11.208848359 -0300
++++ php-5.6.7/aclocal.m4	2015-04-08 11:08:49.828160195 -0300
+@@ -1897,8 +1897,6 @@
+ 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])
+@@ -1930,8 +1928,6 @@
+ 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]) ])
package/php/0001-no-iconv-search.patch deleted +0 -65

65 lines not on this page · raw message

package/php/0002-dlopen.patch deleted +0 -25
deleted file mode 100644
index 1dd009f..0000000
@@ -1,25 +0,0 @@
-PHP can't be AUTORECONF with any modern autotools and the dl tests are
-pretty bad for cross-compilation, so just kill the needed ac_cv value unsets
-so they can flow through from the package makefile.
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
-
-diff -Nura php-5.5.8.orig/configure php-5.5.8/configure
---- php-5.5.8.orig/configure	2014-01-28 17:41:33.943851727 -0300
-+++ php-5.5.8/configure	2014-01-28 17:42:53.785493795 -0300
-@@ -16985,7 +16985,6 @@
- 
- 
- 
--  unset ac_cv_func_dlopen
-   unset ac_cv_func___dlopen
-   unset found
- 
-@@ -17013,7 +17012,6 @@
- 
-     *)
- 
--  unset ac_cv_lib_dl_dlopen
-   unset ac_cv_lib_dl___dlopen
-   unset found
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
package/php/0002-no-iconv-search.patch new file +55 -0

55 lines not on this page · raw message

package/php/0003-disable-pharcmd.patch +5 -4
index d4a8464..bfcc956 100644
@@ -4,11 +4,12 @@ a host-php instance and really probably nobody needs the phar tool
 on the target.
 
 Signed-off-by: Gustavo Zacarias <[email protected]>
+[Gustavo: update for autoreconf/configure.in]
 
-diff -Nura php-5.5.14.orig/configure php-5.5.14/configure
---- php-5.5.14.orig/configure	2014-07-08 09:52:52.657753194 -0300
-+++ php-5.5.14/configure	2014-07-08 09:53:07.610243933 -0300
-@@ -112930,13 +112930,8 @@
+diff -Nura php-5.6.7.orig/configure.in php-5.6.7/configure.in
+--- php-5.6.7.orig/configure.in	2015-04-08 11:08:10.815835010 -0300
++++ php-5.6.7/configure.in	2015-04-08 11:16:20.460467444 -0300
+@@ -1437,13 +1437,8 @@
  INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
  CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
  
package/php/php.mk +7 -0
index ed842b0..12f8eaa 100644
@@ -22,6 +22,13 @@ PHP_CONF_OPTS = \
 	--disable-rpath
 PHP_CONF_ENV = EXTRA_LIBS="$(PHP_EXTRA_LIBS)"
 
+# PHP can't be AUTORECONFed the standard way unfortunately
+PHP_DEPENDENCIES += host-autoconf host-automake host-libtool
+define PHP_BUILDCONF
+	cd $(@D) ; ./buildconf --force
+endef
+PHP_PRE_CONFIGURE_HOOKS += PHP_BUILDCONF
+
 ifeq ($(BR2_ENDIAN),"BIG")
 PHP_CONF_ENV += ac_cv_c_bigendian_php=yes
 else
Signature · 1 line
2.0.5
#2 lore raw

PATCH 2/3 php: cleanup patches

Dear Gustavo Zacarias,

Quoted 5 lines · Gustavo Zacarias

Convert patches from pure configure ones to *.m4/configure.in cleanness. This allows us to AUTORECONF (well, not quite, but close). Even though upstream will probably not accept them it's the right way.

Could you anyway try to submit the patches upstream? The iconv patch will probably need some rework, but it would generally been good to reduce the number of patches in Buildroot.

Nonetheless, patch applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/3 php: cleanup patches

Quoted 5 lines · Thomas Petazzoni

Could you anyway try to submit the patches upstream? The iconv patch will probably need some rework, but it would generally been good to reduce the number of patches in Buildroot.

Nonetheless, patch applied, thanks!

I'll try, but i fully expect upstream to reject it on the base of "automatic legacy compatibility" grounds (i.e. that's needed for solaris or whatnot, and how people build it historically manually). The biggest sticking point would be to get them to ditch the unsets, they probably don't know why they have those in the first place. Regards.

#4 lore raw

PATCH 3/3 php: add opcache option

In reply to Gustavo Zacarias

Add a Zend OPcache option and tweak the build system into being cross-compile friendly.
The OPcache extension allows for a neat intermediate bytecode cache in memory to avoid reinterpreting/recompiling php scripts on multiple runs. Make it an option since this takes up valuable RAM.

---
 package/php/0004-flock-type-linux.patch | 48 +++++++++++++++++++++++++++++++++
 package/php/Config.ext                  |  5 ++++
 package/php/php.mk                      | 13 +++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 package/php/0004-flock-type-linux.patch
package/php/0004-flock-type-linux.patch new file +48 -0
new file mode 100644
index 0000000..a03c262
@@ -0,0 +1,48 @@
+OPcache: flock mechanism is obviously linux so force it.
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+
+diff -Nura php-5.6.7.orig/ext/opcache/config.m4 php-5.6.7/ext/opcache/config.m4
+--- php-5.6.7.orig/ext/opcache/config.m4	2015-04-08 11:08:11.125845540 -0300
++++ php-5.6.7/ext/opcache/config.m4	2015-04-08 11:57:23.648831436 -0300
+@@ -326,38 +326,8 @@
+     msg=yes,msg=no,msg=no)
+   AC_MSG_RESULT([$msg])
+ 
+-flock_type=unknown
+-AC_MSG_CHECKING("whether flock struct is linux ordered")
+-AC_TRY_RUN([
+-  #include <fcntl.h>
+-  struct flock lock = { 1, 2, 3, 4, 5 };
+-  int main() { 
+-    if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
+-		return 0;
+-    }
+-    return 1;
+-  } 
+-], [
+-	flock_type=linux
+-    AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
+-    AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
+-
+-AC_MSG_CHECKING("whether flock struct is BSD ordered")
+-AC_TRY_RUN([
+-  #include <fcntl.h>
+-  struct flock lock = { 1, 2, 3, 4, 5 };
+-  int main() { 
+-    if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
+-		return 0;
+-    }
+-    return 1;
+-  } 
+-], [
+-	flock_type=bsd
+-    AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type]) 
+-    AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
++flock_type=linux
++AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
+ 
+ if test "$flock_type" == "unknown"; then
+ 	AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
package/php/Config.ext +5 -0
index fafae26..a0898b9 100644
@@ -10,6 +10,11 @@ config BR2_PACKAGE_PHP_EXT_FILEINFO
 	help
 	  File Information support
 
+config BR2_PACKAGE_PHP_EXT_OPCACHE
+	bool "OPcache"
+	help
+	  Enable the Zend OPcache accelerator.
+
 config BR2_PACKAGE_PHP_EXT_READLINE
 	bool "Readline"
 	select BR2_PACKAGE_NCURSES
package/php/php.mk +13 -0
index 12f8eaa..eb4f797 100644
@@ -38,6 +38,19 @@ PHP_CONFIG_SCRIPTS = php-config
 
 PHP_CFLAGS = $(TARGET_CFLAGS)
 
+# The OPcache extension isn't cross-compile friendly
+# Throw some defines here to avoid patching heavily
+ifeq ($(BR2_PACKAGE_PHP_EXT_OPCACHE),y)
+PHP_CONF_OPTS += --enable-opcache
+PHP_CONF_ENV += ac_cv_func_mprotect=yes
+PHP_CFLAGS += \
+	-DHAVE_SHM_IPC \
+	-DHAVE_SHM_MMAP_ANON \
+	-DHAVE_SHM_MMAP_ZERO \
+	-DHAVE_SHM_MMAP_POSIX \
+	-DHAVE_SHM_MMAP_FILE
+endif
+
 # We need to force dl "detection"
 ifeq ($(BR2_STATIC_LIBS),)
 PHP_CONF_ENV += ac_cv_func_dlopen=yes ac_cv_lib_dl_dlopen=yes
Signature · 1 line
2.0.5
#5 lore raw

PATCH 3/3 php: add opcache option

Dear Gustavo Zacarias,

package/php/0004-flock-type-linux.patch line 3

Quoted 9 lines · Gustavo Zacarias
package/php/0004-flock-type-linux.patch new file +3 -0
new file mode 100644
index 0000000..a03c262
@@ -0,0 +1,48 @@
+OPcache: flock mechanism is obviously linux so force it.
+
+Signed-off-by: Gustavo Zacarias <[email protected]>

Would have been a nicer (and potentially upstreamable) solution to have a AC_CACHE_VAL that allows to prefeed the result of the tests from the configure environment.

Applied anyway, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 3/3 php: add opcache option

Quoted 5 lines · Thomas Petazzoni

Would have been a nicer (and potentially upstreamable) solution to have a AC_CACHE_VAL that allows to prefeed the result of the tests from the configure environment.

Applied anyway, thanks!

Yes, all of these patches were a first round of getting things cleaner, maybe not 100% clean but cleaner, and get the features, opcache has been included since 5.5.x but we never got it because it was somewhat difficult to get nicely (specially with 5.5.x not being nice to buildconf either).
Regards.

#7 lore raw

PATCH 1/3 php: bump to version 5.6.7

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Quoted 5 lines · Gustavo Zacarias
---
 package/php/php.hash | 2 +-
 package/php/php.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com