* [Buildroot] [PATCH 1/1] package/php: Fix build on arm
@ 2024-08-25 8:30 Bernd Kuhls
2024-08-25 9:55 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Bernd Kuhls @ 2024-08-25 8:30 UTC (permalink / raw)
To: buildroot
Fixes:
http://autobuild.buildroot.org/results/5e8ef91d84018ccdf85f2156292feb3460bfe698/
Without this patch configure wrongfully detects aarch64 support:
checking for aarch64 CRC32 API... yes
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
package/php/php.mk | 4 ++++
1 file changed, 4 insertions(+)
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
PHP_CONFIG_SCRIPTS = php-config
PHP_CFLAGS = $(TARGET_CFLAGS)
--
2.39.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/php: Fix build on arm
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
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-25 9:55 UTC (permalink / raw)
To: Bernd Kuhls; +Cc: buildroot
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-25 9:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox