All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in
@ 2020-12-27 18:31 Bernd Kuhls
  2020-12-27 18:31 ` [Buildroot] [PATCH 2/2] package/php: needs pcre2 Bernd Kuhls
  2020-12-28 21:35 ` [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Bernd Kuhls @ 2020-12-27 18:31 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/pcre2/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/pcre2/Config.in b/package/pcre2/Config.in
index f35877f376..f06f1914f3 100644
--- a/package/pcre2/Config.in
+++ b/package/pcre2/Config.in
@@ -1,4 +1,3 @@
-
 config BR2_PACKAGE_PCRE2
 	bool "pcre2"
 	help
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/php: needs pcre2
  2020-12-27 18:31 [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in Bernd Kuhls
@ 2020-12-27 18:31 ` Bernd Kuhls
  2020-12-28 21:36   ` Thomas Petazzoni
  2021-01-02 21:12   ` Yann E. MORIN
  2020-12-28 21:35 ` [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in Thomas Petazzoni
  1 sibling, 2 replies; 6+ messages in thread
From: Bernd Kuhls @ 2020-12-27 18:31 UTC (permalink / raw)
  To: buildroot

Since 2008 pcre is a hard-dependency of php:
https://github.com/php/php-src/commit/aa64c6727c2d33a647bdbd9769215044f7cf2967

Instead of optionally depending on the pcre2 package and building the
bundled pcre2 code of php in case BR2_PACKAGE_PCRE2 was not selected
we let php depend on pcre2.

While being at it rename the pcre-related configure option due to
upstream commit:
https://github.com/php/php-src/commit/c1a22f3d4e69cb87f8deeed7d03d9434e6901537

Fixes:
http://autobuild.buildroot.net/results/4a5/4a582af6b66c59a61b75a7047d8530202972ebdd/
because the pcre2 package already contains the fix for mips r6.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
Suggested by Peter:
http://lists.busybox.net/pipermail/buildroot/2020-December/299433.html

 package/php/Config.in |  1 +
 package/php/php.mk    | 31 ++-----------------------------
 2 files changed, 3 insertions(+), 29 deletions(-)

diff --git a/package/php/Config.in b/package/php/Config.in
index 2469573541..6fa420428b 100644
--- a/package/php/Config.in
+++ b/package/php/Config.in
@@ -10,6 +10,7 @@ config BR2_PACKAGE_PHP
 	       !BR2_PACKAGE_PHP_SAPI_FPM &&  \
 	       BR2_USE_MMU
 	select BR2_PACKAGE_PHP_SAPI_CLI if !BR2_USE_MMU
+	select BR2_PACKAGE_PCRE2
 	help
 	  PHP  is a widely-used general-purpose scripting
 	  language that is especially suited for Web development
diff --git a/package/php/php.mk b/package/php/php.mk
index 0feb96e97a..792e523ebe 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -10,7 +10,7 @@ PHP_SOURCE = php-$(PHP_VERSION).tar.xz
 PHP_INSTALL_STAGING = YES
 PHP_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
 PHP_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
-PHP_DEPENDENCIES = host-pkgconf
+PHP_DEPENDENCIES = host-pkgconf pcre2
 PHP_LICENSE = PHP-3.01
 PHP_LICENSE_FILES = LICENSE
 PHP_CONF_OPTS = \
@@ -18,6 +18,7 @@ PHP_CONF_OPTS = \
 	--infodir=/usr/share/info \
 	--with-config-file-scan-dir=/etc/php.d \
 	--disable-all \
+	--with-external-pcre \
 	--without-pear \
 	--with-config-file-path=/etc \
 	--disable-phpdbg \
@@ -258,34 +259,6 @@ define PHP_DISABLE_VALGRIND
 endef
 PHP_POST_CONFIGURE_HOOKS += PHP_DISABLE_VALGRIND
 
-### Use external PCRE if it's available
-ifeq ($(BR2_PACKAGE_PCRE2),y)
-PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr
-PHP_DEPENDENCIES += pcre2
-
-ifeq ($(BR2_PACKAGE_PCRE2_JIT),y)
-PHP_CONF_OPTS += --with-pcre-jit=yes
-PHP_CONF_ENV += ac_cv_have_pcre2_jit=yes
-else
-PHP_CONF_OPTS += --with-pcre-jit=no
-PHP_CONF_ENV += ac_cv_have_pcre2_jit=no
-endif
-
-else
-# The bundled pcre library is not configurable through ./configure options,
-# and by default is configured to be thread-safe, so it wants pthreads. So
-# we must explicitly tell it when we don't have threads.
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
-PHP_CFLAGS += -DSLJIT_SINGLE_THREADED=1
-endif
-# check ext/pcre/pcrelib/sljit/sljitConfigInternal.h for supported archs
-ifeq ($(BR2_i386)$(BR2_x86_64)$(BR2_arm)$(BR2_armeb)$(BR2_aarch64)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),y)
-PHP_CONF_OPTS += --with-pcre-jit
-else
-PHP_CONF_OPTS += --without-pcre-jit
-endif
-endif
-
 ifeq ($(BR2_PACKAGE_PHP_EXT_CURL),y)
 PHP_CONF_OPTS += --with-curl
 PHP_DEPENDENCIES += libcurl
-- 
2.29.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in
  2020-12-27 18:31 [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in Bernd Kuhls
  2020-12-27 18:31 ` [Buildroot] [PATCH 2/2] package/php: needs pcre2 Bernd Kuhls
@ 2020-12-28 21:35 ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2020-12-28 21:35 UTC (permalink / raw)
  To: buildroot

On Sun, 27 Dec 2020 19:31:44 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  package/pcre2/Config.in | 1 -
>  1 file changed, 1 deletion(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/php: needs pcre2
  2020-12-27 18:31 ` [Buildroot] [PATCH 2/2] package/php: needs pcre2 Bernd Kuhls
@ 2020-12-28 21:36   ` Thomas Petazzoni
  2021-01-02 21:05     ` Yann E. MORIN
  2021-01-02 21:12   ` Yann E. MORIN
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2020-12-28 21:36 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 27 Dec 2020 19:31:45 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> -### Use external PCRE if it's available
> -ifeq ($(BR2_PACKAGE_PCRE2),y)
> -PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr
> -PHP_DEPENDENCIES += pcre2
> -
> -ifeq ($(BR2_PACKAGE_PCRE2_JIT),y)
> -PHP_CONF_OPTS += --with-pcre-jit=yes
> -PHP_CONF_ENV += ac_cv_have_pcre2_jit=yes
> -else
> -PHP_CONF_OPTS += --with-pcre-jit=no
> -PHP_CONF_ENV += ac_cv_have_pcre2_jit=no
> -endif

Are you sure this is no longer needed ? According to
https://github.com/php/php-src/commit/c1a22f3d4e69cb87f8deeed7d03d9434e6901537
that you are pointing, the --with-pcre-jit option is not only for the
bundled PCRE.

This PCRE JIT stuff was relatively recently added by Buildroot commit
58896f5c976bb61391ab34bb5826f429346f9a6a.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/php: needs pcre2
  2020-12-28 21:36   ` Thomas Petazzoni
@ 2021-01-02 21:05     ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2021-01-02 21:05 UTC (permalink / raw)
  To: buildroot

Thomas, Bernd, All,

On 2020-12-28 22:36 +0100, Thomas Petazzoni spake thusly:
> On Sun, 27 Dec 2020 19:31:45 +0100
> Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
> 
> > -### Use external PCRE if it's available
> > -ifeq ($(BR2_PACKAGE_PCRE2),y)
> > -PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr
> > -PHP_DEPENDENCIES += pcre2
> > -
> > -ifeq ($(BR2_PACKAGE_PCRE2_JIT),y)
> > -PHP_CONF_OPTS += --with-pcre-jit=yes
> > -PHP_CONF_ENV += ac_cv_have_pcre2_jit=yes
> > -else
> > -PHP_CONF_OPTS += --with-pcre-jit=no
> > -PHP_CONF_ENV += ac_cv_have_pcre2_jit=no
> > -endif
> 
> Are you sure this is no longer needed ? According to
> https://github.com/php/php-src/commit/c1a22f3d4e69cb87f8deeed7d03d9434e6901537
> that you are pointing, the --with-pcre-jit option is not only for the
> bundled PCRE.

In fact, when cross-compiling, php will rely on a hard-coded list of
architectures for which it believes JIT is available:

https://github.com/php/php-src/blob/3e2e0b58484c5364aca026b7b3df769a63dc5389/ext/pcre/config0.m4#L24

Note that they got an incomplete list, as AArch64 does has JIT support,
but it is not in PHP's whitelist.

So we indeed still need to explicitly enable or disable JIT *and*
continue to pass the cache-variable to ocverride autodetection.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/php: needs pcre2
  2020-12-27 18:31 ` [Buildroot] [PATCH 2/2] package/php: needs pcre2 Bernd Kuhls
  2020-12-28 21:36   ` Thomas Petazzoni
@ 2021-01-02 21:12   ` Yann E. MORIN
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2021-01-02 21:12 UTC (permalink / raw)
  To: buildroot

Bernd, All,

On 2020-12-27 19:31 +0100, Bernd Kuhls spake thusly:
> Since 2008 pcre is a hard-dependency of php:
> https://github.com/php/php-src/commit/aa64c6727c2d33a647bdbd9769215044f7cf2967
> 
> Instead of optionally depending on the pcre2 package and building the
> bundled pcre2 code of php in case BR2_PACKAGE_PCRE2 was not selected
> we let php depend on pcre2.
> 
> While being at it rename the pcre-related configure option due to
> upstream commit:
> https://github.com/php/php-src/commit/c1a22f3d4e69cb87f8deeed7d03d9434e6901537
> 
> Fixes:
> http://autobuild.buildroot.net/results/4a5/4a582af6b66c59a61b75a7047d8530202972ebdd/
> because the pcre2 package already contains the fix for mips r6.
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>

Applied to master, thanks, but keeping the pcre2 JIT option as noticed
by Thomas.

Regards,
Yann E. MORIN.

> ---
> Suggested by Peter:
> http://lists.busybox.net/pipermail/buildroot/2020-December/299433.html
> 
>  package/php/Config.in |  1 +
>  package/php/php.mk    | 31 ++-----------------------------
>  2 files changed, 3 insertions(+), 29 deletions(-)
> 
> diff --git a/package/php/Config.in b/package/php/Config.in
> index 2469573541..6fa420428b 100644
> --- a/package/php/Config.in
> +++ b/package/php/Config.in
> @@ -10,6 +10,7 @@ config BR2_PACKAGE_PHP
>  	       !BR2_PACKAGE_PHP_SAPI_FPM &&  \
>  	       BR2_USE_MMU
>  	select BR2_PACKAGE_PHP_SAPI_CLI if !BR2_USE_MMU
> +	select BR2_PACKAGE_PCRE2
>  	help
>  	  PHP  is a widely-used general-purpose scripting
>  	  language that is especially suited for Web development
> diff --git a/package/php/php.mk b/package/php/php.mk
> index 0feb96e97a..792e523ebe 100644
> --- a/package/php/php.mk
> +++ b/package/php/php.mk
> @@ -10,7 +10,7 @@ PHP_SOURCE = php-$(PHP_VERSION).tar.xz
>  PHP_INSTALL_STAGING = YES
>  PHP_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
>  PHP_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
> -PHP_DEPENDENCIES = host-pkgconf
> +PHP_DEPENDENCIES = host-pkgconf pcre2
>  PHP_LICENSE = PHP-3.01
>  PHP_LICENSE_FILES = LICENSE
>  PHP_CONF_OPTS = \
> @@ -18,6 +18,7 @@ PHP_CONF_OPTS = \
>  	--infodir=/usr/share/info \
>  	--with-config-file-scan-dir=/etc/php.d \
>  	--disable-all \
> +	--with-external-pcre \
>  	--without-pear \
>  	--with-config-file-path=/etc \
>  	--disable-phpdbg \
> @@ -258,34 +259,6 @@ define PHP_DISABLE_VALGRIND
>  endef
>  PHP_POST_CONFIGURE_HOOKS += PHP_DISABLE_VALGRIND
>  
> -### Use external PCRE if it's available
> -ifeq ($(BR2_PACKAGE_PCRE2),y)
> -PHP_CONF_OPTS += --with-pcre-regex=$(STAGING_DIR)/usr
> -PHP_DEPENDENCIES += pcre2
> -
> -ifeq ($(BR2_PACKAGE_PCRE2_JIT),y)
> -PHP_CONF_OPTS += --with-pcre-jit=yes
> -PHP_CONF_ENV += ac_cv_have_pcre2_jit=yes
> -else
> -PHP_CONF_OPTS += --with-pcre-jit=no
> -PHP_CONF_ENV += ac_cv_have_pcre2_jit=no
> -endif
> -
> -else
> -# The bundled pcre library is not configurable through ./configure options,
> -# and by default is configured to be thread-safe, so it wants pthreads. So
> -# we must explicitly tell it when we don't have threads.
> -ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
> -PHP_CFLAGS += -DSLJIT_SINGLE_THREADED=1
> -endif
> -# check ext/pcre/pcrelib/sljit/sljitConfigInternal.h for supported archs
> -ifeq ($(BR2_i386)$(BR2_x86_64)$(BR2_arm)$(BR2_armeb)$(BR2_aarch64)$(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el)$(BR2_powerpc)$(BR2_sparc),y)
> -PHP_CONF_OPTS += --with-pcre-jit
> -else
> -PHP_CONF_OPTS += --without-pcre-jit
> -endif
> -endif
> -
>  ifeq ($(BR2_PACKAGE_PHP_EXT_CURL),y)
>  PHP_CONF_OPTS += --with-curl
>  PHP_DEPENDENCIES += libcurl
> -- 
> 2.29.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-02 21:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-27 18:31 [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in Bernd Kuhls
2020-12-27 18:31 ` [Buildroot] [PATCH 2/2] package/php: needs pcre2 Bernd Kuhls
2020-12-28 21:36   ` Thomas Petazzoni
2021-01-02 21:05     ` Yann E. MORIN
2021-01-02 21:12   ` Yann E. MORIN
2020-12-28 21:35 ` [Buildroot] [PATCH 1/2] package/pcre2: remove empty line from Config.in Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.