diff mbox series

[1/1] package/php: add BR2_PACKAGE_PHP_ARCH_SUPPORTS

Message ID 20220618085704.508506-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/php: add BR2_PACKAGE_PHP_ARCH_SUPPORTS | expand

Commit Message

Fabrice Fontaine June 18, 2022, 8:57 a.m. UTC
fiber (https://wiki.php.net/rfc/fibers) has been added in version 8.1.0
with
https://github.com/php/php-src/commit/c276c16b6627222c40bd43907475d664734b9abe

fiber uses asm on supported architectures or needs ucontext since
https://github.com/php/php-src/commit/8fd747a2a0e9f57c12bdad22a1844a736e7b4e57

As result, the following build failure is raised without ucontext_t on
architectures not supported by asm since bump to version 8.1.7 in commit
0ddfece7f7e5b10a5da89f2c462616d5deb5b1ec:

/home/giuliobenetti/autobuild/run/instance-3/output-1/host/lib/gcc/arc-buildroot-linux-uclibc/10.2.0/../../../../arc-buildroot-linux-uclibc/bin/ld: Zend/zend_fibers.o: in function `zend_fiber_init_context':
zend_fibers.c:(.text+0x68a): undefined reference to `getcontext'

As fiber can't be disabled (only fiber-asm), add
BR2_PACKAGE_PHP_ARCH_SUPPORTS to reflect this new dependency

Fixes:
 - http://autobuild.buildroot.org/results/f4077bae8f879828e343475318cd2ddb99e09ba4

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/php/Config.in | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Arnout Vandecappelle July 23, 2022, 7:10 p.m. UTC | #1
On 18/06/2022 10:57, Fabrice Fontaine wrote:
> fiber (https://wiki.php.net/rfc/fibers) has been added in version 8.1.0
> with
> https://github.com/php/php-src/commit/c276c16b6627222c40bd43907475d664734b9abe
> 
> fiber uses asm on supported architectures or needs ucontext since
> https://github.com/php/php-src/commit/8fd747a2a0e9f57c12bdad22a1844a736e7b4e57
> 
> As result, the following build failure is raised without ucontext_t on
> architectures not supported by asm since bump to version 8.1.7 in commit
> 0ddfece7f7e5b10a5da89f2c462616d5deb5b1ec:
> 
> /home/giuliobenetti/autobuild/run/instance-3/output-1/host/lib/gcc/arc-buildroot-linux-uclibc/10.2.0/../../../../arc-buildroot-linux-uclibc/bin/ld: Zend/zend_fibers.o: in function `zend_fiber_init_context':
> zend_fibers.c:(.text+0x68a): undefined reference to `getcontext'
> 
> As fiber can't be disabled (only fiber-asm), add
> BR2_PACKAGE_PHP_ARCH_SUPPORTS to reflect this new dependency
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/f4077bae8f879828e343475318cd2ddb99e09ba4
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/php/Config.in | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/package/php/Config.in b/package/php/Config.in
> index 226d2d5fd2..69b4268c1d 100644
> --- a/package/php/Config.in
> +++ b/package/php/Config.in
> @@ -1,5 +1,18 @@
> +config BR2_PACKAGE_PHP_ARCH_SUPPORTS
> +	bool
> +	# see fiber_cpu in configure.ac
> +	default y if BR2_aarch64 || BR2_aarch64_be
> +	default y if BR2_arm || BR2_armeb
> +	default y if BR2_i386 || BR2_x86_64
> +	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
> +	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
> +	default y if BR2_RISCV_64
> +	default y if BR2_s390x
> +	default y if BR2_TOOLCHAIN_HAS_UCONTEXT
> +
>   config BR2_PACKAGE_PHP
>   	bool "php"
> +	depends on BR2_PACKAGE_PHP_ARCH_SUPPORTS
>   	# PHP uses -export-dynamic, which breaks with elf2flt with a
>   	# message like "ld.real: section .junk LMA [...,...] overlaps
>   	# section .text LMA [...,...]"
> @@ -52,5 +65,6 @@ source "package/php/Config.ext"
>   endif
>   
>   comment "php needs a toolchain w/ wchar"
> +	depends on BR2_PACKAGE_PHP_ARCH_SUPPORTS
>   	depends on !BR2_BINFMT_FLAT
>   	depends on !BR2_USE_WCHAR
diff mbox series

Patch

diff --git a/package/php/Config.in b/package/php/Config.in
index 226d2d5fd2..69b4268c1d 100644
--- a/package/php/Config.in
+++ b/package/php/Config.in
@@ -1,5 +1,18 @@ 
+config BR2_PACKAGE_PHP_ARCH_SUPPORTS
+	bool
+	# see fiber_cpu in configure.ac
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_i386 || BR2_x86_64
+	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_RISCV_64
+	default y if BR2_s390x
+	default y if BR2_TOOLCHAIN_HAS_UCONTEXT
+
 config BR2_PACKAGE_PHP
 	bool "php"
+	depends on BR2_PACKAGE_PHP_ARCH_SUPPORTS
 	# PHP uses -export-dynamic, which breaks with elf2flt with a
 	# message like "ld.real: section .junk LMA [...,...] overlaps
 	# section .text LMA [...,...]"
@@ -52,5 +65,6 @@  source "package/php/Config.ext"
 endif
 
 comment "php needs a toolchain w/ wchar"
+	depends on BR2_PACKAGE_PHP_ARCH_SUPPORTS
 	depends on !BR2_BINFMT_FLAT
 	depends on !BR2_USE_WCHAR