Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Bernd Kuhls <bernd@kuhls.net>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/php: Fix build on arm
Date: Sun, 25 Aug 2024 11:55:03 +0200	[thread overview]
Message-ID: <20240825115503.49974f0f@windsurf> (raw)
In-Reply-To: <20240825083041.1020638-1-bernd@kuhls.net>

Hello Bernd,

On Sun, 25 Aug 2024 10:30:41 +0200
Bernd Kuhls <bernd@kuhls.net> wrote:

> diff --git a/package/php/php.mk b/package/php/php.mk
> index 0487c03b61..6266ef4e7f 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -64,6 +64,10 @@ PHP_CONF_ENV += ac_cv_c_bigendian_php=yes
>  else
>  PHP_CONF_ENV += ac_cv_c_bigendian_php=no
>  endif
> +# fix configure check for aarch64 CRC32 API
> +ifeq ($(BR2_arm)$(BR2_armeb),y)
> +PHP_CONF_ENV += ac_cv_func___crc32d=no
> +endif

Thanks, but this sort of thing really needs to be fixed in the upstream
configure.ac. Indeed if you have to override cache variables like this,
it means that the configure.ac check is defective.

Could you try instead:

diff --git a/configure.ac b/configure.ac
index 491963daae2..2693ba09f4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -696,7 +696,19 @@ AC_FUNC_ALLOCA
 PHP_TIME_R_TYPE
 
 AC_CACHE_CHECK([for aarch64 CRC32 API], [php_cv_func___crc32d],
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <arm_acle.h>], [__crc32d(0, 0);])],
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([
+#include <arm_acle.h>
+# if defined(__GNUC__)
+#  if!defined(__clang__)
+#   pragma GCC push_options
+#   pragma GCC target ("+nothing+crc")
+#  elif defined(__APPLE__)
+#   pragma clang attribute push(__attribute__((target("crc"))), apply_to=function)
+#  else
+#   pragma clang attribute push(__attribute__((target("+nothing+crc"))), apply_to=function)
+#  endif
+# endif
+], [__crc32d(0, 0);])],
 [php_cv_func___crc32d=yes],
 [php_cv_func___crc32d=no])])
 AS_VAR_IF([php_cv_func___crc32d], [yes],

Could you try this, and check it works as expected on ARM 32-bit, and
AArch64 ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2024-08-25  9:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-25  8:30 [Buildroot] [PATCH 1/1] package/php: Fix build on arm Bernd Kuhls
2024-08-25  9:55 ` Thomas Petazzoni via buildroot [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=20240825115503.49974f0f@windsurf \
    --to=buildroot@buildroot.org \
    --cc=bernd@kuhls.net \
    --cc=thomas.petazzoni@bootlin.com \
    /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