All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads
@ 2020-01-21 19:29 Clayton Shotwell
  2020-01-21 22:23 ` Arnout Vandecappelle
  2021-01-05 21:39 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Clayton Shotwell @ 2020-01-21 19:29 UTC (permalink / raw)
  To: buildroot

From: Hector Kesari <hector.kesari@rockwellcollins.com>

Add config option for Perl to enable threads usage.

Signed-off-by: Hector Kesari <hector.kesari@rockwellcollins.com>
Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>

---
Changes v1 -> v2:
  - Changed references of PERL to Perl
  - Added a warning about using Perl threads
---
 package/perl/Config.in | 13 +++++++++++++
 package/perl/perl.mk   |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/package/perl/Config.in b/package/perl/Config.in
index 32a3fd2ee9..34b87ee575 100644
--- a/package/perl/Config.in
+++ b/package/perl/Config.in
@@ -24,4 +24,17 @@ config BR2_PACKAGE_PERL_MODULES
 	  Leave empty for all modules (as far as the external libraries
 	  are available).
 
+config BR2_PACKAGE_PERL_ENABLE_THREADS
+	bool "Support for Threads in Perl"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Enable use of threads in Perl scripts
+
+	  WARNING: The use of interpreter-based threads in Perl
+	  is officially discouraged.
+	  See https://perldoc.perl.org/threads.html#WARNING
+
+comment "Perl threads need toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+
 endif
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 0ab81ddb34..e0bbf9cfd4 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -62,6 +62,10 @@ ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
 PERL_CONF_OPTS += -Dusedevel
 endif
 
+ifeq ($(BR2_PACKAGE_PERL_ENABLE_THREADS),y)
+PERL_CONF_OPTS += -Dusethreads
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 PERL_CONF_OPTS += --all-static --no-dynaloader
 endif
-- 
2.23.0

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

* [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads
  2020-01-21 19:29 [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads Clayton Shotwell
@ 2020-01-21 22:23 ` Arnout Vandecappelle
  2020-01-22 13:45   ` Clayton Shotwell
  2021-01-05 21:39 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2020-01-21 22:23 UTC (permalink / raw)
  To: buildroot



On 21/01/2020 20:29, Clayton Shotwell wrote:
> From: Hector Kesari <hector.kesari@rockwellcollins.com>
> 
> Add config option for Perl to enable threads usage.
> 
> Signed-off-by: Hector Kesari <hector.kesari@rockwellcollins.com>
> Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> 
> ---
> Changes v1 -> v2:
>   - Changed references of PERL to Perl
>   - Added a warning about using Perl threads
> ---
>  package/perl/Config.in | 13 +++++++++++++
>  package/perl/perl.mk   |  4 ++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/package/perl/Config.in b/package/perl/Config.in
> index 32a3fd2ee9..34b87ee575 100644
> --- a/package/perl/Config.in
> +++ b/package/perl/Config.in
> @@ -24,4 +24,17 @@ config BR2_PACKAGE_PERL_MODULES
>  	  Leave empty for all modules (as far as the external libraries
>  	  are available).
>  
> +config BR2_PACKAGE_PERL_ENABLE_THREADS
> +	bool "Support for Threads in Perl"
> +	depends on BR2_TOOLCHAIN_HAS_THREADS
> +	help
> +	  Enable use of threads in Perl scripts
> +
> +	  WARNING: The use of interpreter-based threads in Perl
> +	  is officially discouraged.
> +	  See https://perldoc.perl.org/threads.html#WARNING

 So why do you want it then?

 Regards,
 Arnout

> +
> +comment "Perl threads need toolchain w/ threads"
> +	depends on !BR2_TOOLCHAIN_HAS_THREADS
> +
>  endif
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index 0ab81ddb34..e0bbf9cfd4 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -62,6 +62,10 @@ ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
>  PERL_CONF_OPTS += -Dusedevel
>  endif
>  
> +ifeq ($(BR2_PACKAGE_PERL_ENABLE_THREADS),y)
> +PERL_CONF_OPTS += -Dusethreads
> +endif
> +
>  ifeq ($(BR2_STATIC_LIBS),y)
>  PERL_CONF_OPTS += --all-static --no-dynaloader
>  endif
> 

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

* [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads
  2020-01-21 22:23 ` Arnout Vandecappelle
@ 2020-01-22 13:45   ` Clayton Shotwell
  0 siblings, 0 replies; 4+ messages in thread
From: Clayton Shotwell @ 2020-01-22 13:45 UTC (permalink / raw)
  To: buildroot

On Tue, Jan 21, 2020 at 4:23 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 21/01/2020 20:29, Clayton Shotwell wrote:
> > From: Hector Kesari <hector.kesari@rockwellcollins.com>
> >
> > Add config option for Perl to enable threads usage.
> >
> > Signed-off-by: Hector Kesari <hector.kesari@rockwellcollins.com>
> > Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> >
> > ---
> > Changes v1 -> v2:
> >   - Changed references of PERL to Perl
> >   - Added a warning about using Perl threads
> > ---
> >  package/perl/Config.in | 13 +++++++++++++
> >  package/perl/perl.mk   |  4 ++++
> >  2 files changed, 17 insertions(+)
> >
> > diff --git a/package/perl/Config.in b/package/perl/Config.in
> > index 32a3fd2ee9..34b87ee575 100644
> > --- a/package/perl/Config.in
> > +++ b/package/perl/Config.in
> > @@ -24,4 +24,17 @@ config BR2_PACKAGE_PERL_MODULES
> >         Leave empty for all modules (as far as the external libraries
> >         are available).
> >
> > +config BR2_PACKAGE_PERL_ENABLE_THREADS
> > +     bool "Support for Threads in Perl"
> > +     depends on BR2_TOOLCHAIN_HAS_THREADS
> > +     help
> > +       Enable use of threads in Perl scripts
> > +
> > +       WARNING: The use of interpreter-based threads in Perl
> > +       is officially discouraged.
> > +       See https://perldoc.perl.org/threads.html#WARNING
>
>  So why do you want it then?

Goal of the program is to not modify the perl code since it "works".
There may be others
with older code bases that could use the thread support.

Thanks,
Clayton

>
>  Regards,
>  Arnout
>
> > +
> > +comment "Perl threads need toolchain w/ threads"
> > +     depends on !BR2_TOOLCHAIN_HAS_THREADS
> > +
> >  endif
> > diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> > index 0ab81ddb34..e0bbf9cfd4 100644
> > --- a/package/perl/perl.mk
> > +++ b/package/perl/perl.mk
> > @@ -62,6 +62,10 @@ ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
> >  PERL_CONF_OPTS += -Dusedevel
> >  endif
> >
> > +ifeq ($(BR2_PACKAGE_PERL_ENABLE_THREADS),y)
> > +PERL_CONF_OPTS += -Dusethreads
> > +endif
> > +
> >  ifeq ($(BR2_STATIC_LIBS),y)
> >  PERL_CONF_OPTS += --all-static --no-dynaloader
> >  endif
> >

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

* [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads
  2020-01-21 19:29 [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads Clayton Shotwell
  2020-01-21 22:23 ` Arnout Vandecappelle
@ 2021-01-05 21:39 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2021-01-05 21:39 UTC (permalink / raw)
  To: buildroot

On Tue, 21 Jan 2020 13:29:16 -0600
Clayton Shotwell <clayton.shotwell@rockwellcollins.com> wrote:

> From: Hector Kesari <hector.kesari@rockwellcollins.com>
> 
> Add config option for Perl to enable threads usage.
> 
> Signed-off-by: Hector Kesari <hector.kesari@rockwellcollins.com>
> Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com>
> 
> ---
> Changes v1 -> v2:
>   - Changed references of PERL to Perl
>   - Added a warning about using Perl threads
> ---
>  package/perl/Config.in | 13 +++++++++++++
>  package/perl/perl.mk   |  4 ++++
>  2 files changed, 17 insertions(+)

Even though Arnout was not sure, this patch has been around for a long
time, the complexity is very low, so I applied to master with a few
tweaks.

Thanks!

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

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 19:29 [Buildroot] [PATCH v2 1/1] perl: Add option to enable threads Clayton Shotwell
2020-01-21 22:23 ` Arnout Vandecappelle
2020-01-22 13:45   ` Clayton Shotwell
2021-01-05 21:39 ` 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.