aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-06-29 17:24:21 +0100
committerRoss Burton <ross.burton@intel.com>2019-07-11 11:01:51 +0100
commit11396bb3b49e244165d80070ce3ae0a5d432257d (patch)
tree49db2e2fc8dadb370f9a1cbdbc89be166a5794a7
parentf2af228da2d0764f2753c2d5cee68c68fda072e8 (diff)
downloadmeta-openembedded-contrib-ross/php.tar.gz
php: disable non-deterministic valgrindross/php
Valgrind support in PHP looks on the host for Valgrind headers, backport a patch from upstream so that Valgrind support is disabled by default. Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta-oe/recipes-devtools/php/php.inc1
-rw-r--r--meta-oe/recipes-devtools/php/php/valgrind.patch115
2 files changed, 116 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php.inc b/meta-oe/recipes-devtools/php/php.inc
index 785c2f5acc..4f8e45f575 100644
--- a/meta-oe/recipes-devtools/php/php.inc
+++ b/meta-oe/recipes-devtools/php/php.inc
@@ -22,6 +22,7 @@ SRC_URI_append_class-target = " \
file://php-fpm-apache.conf \
file://70_mod_php${PHP_MAJOR_VERSION}.conf \
file://php-fpm.service \
+ file://valgrind.patch \
"
S = "${WORKDIR}/php-${PV}"
diff --git a/meta-oe/recipes-devtools/php/php/valgrind.patch b/meta-oe/recipes-devtools/php/php/valgrind.patch
new file mode 100644
index 0000000000..c3e232ba23
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php/valgrind.patch
@@ -0,0 +1,115 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 25ba60b1479eb332a7388732f3ee5467000fbe73 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Wed, 14 Feb 2018 14:46:17 +0100
+Subject: [PATCH] Fixed bug #75722: Rework valgrind detection
+
+As described in bug report #75722, the configure script (acinclude.m4)
+currently searches for the valgrind header file and enables valgrind
+support if found.
+
+When cross-compiling the searched paths are invalid for the target
+platform because they belong to the host system. At the moment, there is
+no way to tell the build system a dedicated path where to look for the
+header file.
+
+This leads to the issue, that when cross-compiling eg. for ARMv5 platform,
+that valgrind header file is detected - e.g. because host system is amd64 -
+and support is enabled - but target platform will never support valgrind
+(valgrind requires e.g. at least ARMv7).
+
+This change reworks the detection so that user could manually opt-in
+valgrind support and optionally specify a directory where the build system
+should look for the header file using the --with-valgrind option.
+---
+ NEWS | 4 ++++
+ acinclude.m4 | 20 --------------------
+ configure.ac | 30 +++++++++++++++++++++++++++++-
+ 3 files changed, 33 insertions(+), 21 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 1faf13831ebd..5d65fd083357 100644
+--- a/NEWS
++++ b/NEWS
+@@ -2,6 +2,10 @@ PHP NEWS
+ |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+ ?? ??? 2018, PHP 7.2.5
+
++- Core:
++ . Fixed bug #75722 (Convert valgrind detection to configure option).
++ (Michael Heimpold)
++
+ - Mbstring:
+ . Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
+ . Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1).
+diff --git a/acinclude.m4 b/acinclude.m4
+index d42d70853515..eb06cb7e363f 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -3249,23 +3249,3 @@ AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
+
+ dnl Load the AX_CHECK_COMPILE_FLAG macro from the autoconf archive.
+ m4_include([build/ax_check_compile_flag.m4])
+-
+-dnl PHP_CHECK_VALGRIND
+-AC_DEFUN([PHP_CHECK_VALGRIND], [
+- AC_MSG_CHECKING([for valgrind])
+-
+- SEARCH_PATH="/usr/local /usr"
+- SEARCH_FOR="/include/valgrind/valgrind.h"
+- for i in $SEARCH_PATH ; do
+- if test -r $i/$SEARCH_FOR; then
+- VALGRIND_DIR=$i
+- fi
+- done
+-
+- if test -z "$VALGRIND_DIR"; then
+- AC_MSG_RESULT([not found])
+- else
+- AC_MSG_RESULT(found in $VALGRIND_DIR)
+- AC_DEFINE(HAVE_VALGRIND, 1, [ ])
+- fi
+-])
+diff --git a/configure.ac b/configure.ac
+index 05f94f08a9c8..c5d9be978bda 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -753,7 +753,35 @@ if test "x$php_crypt_r" = "x1"; then
+ PHP_CRYPT_R_STYLE
+ fi
+
+-PHP_CHECK_VALGRIND
++dnl Check valgrind support
++PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
++[ --with-valgrind=DIR Enable valgrind support], yes, no)
++
++if test "$PHP_VALGRIND" != "no"; then
++
++ AC_MSG_CHECKING([for valgrind header])
++
++ if test "$PHP_VALGRIND" = "yes"; then
++ SEARCH_PATH="/usr/local /usr"
++ else
++ SEARCH_PATH="$PHP_VALGRIND"
++ fi
++
++ SEARCH_FOR="/include/valgrind/valgrind.h"
++ for i in $SEARCH_PATH ; do
++ if test -r $i/$SEARCH_FOR; then
++ VALGRIND_DIR=$i
++ fi
++ done
++
++ if test -z "$VALGRIND_DIR"; then
++ AC_MSG_RESULT([not found])
++ else
++ AC_MSG_RESULT(found in $VALGRIND_DIR)
++ AC_DEFINE(HAVE_VALGRIND, 1, [ ])
++ fi
++
++fi
+
+ dnl General settings.
+ dnl ------------------------------------------------------------------------- \ No newline at end of file