Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [master 1/1] php: disable valgrind
Date: Tue, 13 Feb 2018 22:42:58 +0100	[thread overview]
Message-ID: <20180213224258.70de201b@windsurf.lan> (raw)
In-Reply-To: <20180212170112.12313-1-aduskett@gmail.com>

Hello,

On Mon, 12 Feb 2018 12:01:12 -0500, Adam Duskett wrote:
> Introduced in PHP7.2, if a host has valgrind headers installed, PHP will detect
> them and set HAVE_VALGRIND to 1.
> Disable this entry after configuring.
> 
> fixes:
> http://autobuild.buildroot.net/results/d59/d59b5961890aeddcd6d59ed52243be6554d1fe21
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
>  package/php/php.mk | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/package/php/php.mk b/package/php/php.mk
> index a4481c45c7..e6bc1e47e1 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -232,6 +232,11 @@ define PHP_DISABLE_PCRE_JIT
>  	$(SED) '/^#define SUPPORT_JIT/d' $(@D)/ext/pcre/pcrelib/config.h
>  endef
>  
> +define PHP_DISABLE_VALGRIND
> +	$(SED) '/^#define HAVE_VALGRIND/d' $(@D)/main/php_config.h
> +endef
> +PHP_POST_CONFIGURE_HOOKS += PHP_DISABLE_VALGRIND

Thanks, applied to master. But when I look at the reason why Valgrind
is incorrectly detected, then I understand why people hate autoconf:
because they don't understand at all how to use it properly, do
completely non-sense utter crap with it, and then complain that
autoconf sucks.

They do this non-sense:

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
])

Which could be replaced be:

	AC_CHECK_HEADERS([valgrind/valgrind.h])

(HAVE_VALGRIND would have to be replaced by HAVE_VALGRIND_VALGRIND_H)

Which has several advantages:

 - It is much shorter
 - It is not utterly broken for cross-compilation
 - It supports a cache variable

If you're in the mood to send a patch to PHP upstream, I think this
would be a useful contribution.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

      reply	other threads:[~2018-02-13 21:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 17:01 [Buildroot] [master 1/1] php: disable valgrind Adam Duskett
2018-02-13 21:42 ` Thomas Petazzoni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180213224258.70de201b@windsurf.lan \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox