Skip to contentSkip to conversation

perl: Enable threading

PATCH In review Saul Wold 3 participants 7 messages Jan 6, 2022 – Jan 10, 2022

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH v2 1/1 perl: Enable threading

From: Saul Wold <[email protected]>

When the tranisiton to perl-cross occured, the threading define seems to have been missed. The perl tests for threading where simply skipped, so there was no direct failures. This was verified by running perl ptest before and after the change to see PASS vs SKIP results of threaded related tests.

NOTE: Perl officially discourges the use of threads, so this functionality maybe depercated in the future [0][1]

v2: adds the usethreads to native and nativesdk. This was tested by builing postresql and rrdtool which use perl and automake.

[0] https://perldoc.perl.org/5.34.0-RC2/threads#WARNING
[1] https://perldoc.perl.org/perlpolicy#discouraged

---
 meta/recipes-devtools/perl/perl_5.34.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/perl/perl_5.34.0.bb +3 -0
index a6ae80f07e1..e4bcfe3ce69 100644
@@ -53,6 +53,7 @@ do_configure:class-target() {
     ./configure --prefix=${prefix} --libdir=${libdir} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -80,6 +81,7 @@ do_configure:class-nativesdk() {
     ./configure --prefix=${prefix} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -94,6 +96,7 @@ do_configure:class-native() {
     ./configure --prefix=${prefix} \
     -Dbin=${bindir}/perl-native \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Ui_xlocale \
Signature · 1 line
2.31.1
#1 lore raw

Hi,

Quoted 44 lines · Saul Wold

From: Saul Wold <[email protected]>

When the tranisiton to perl-cross occured, the threading define seems to have been missed. The perl tests for threading where simply skipped, so there was no direct failures. This was verified by running perl ptest before and after the change to see PASS vs SKIP results of threaded related tests.

NOTE: Perl officially discourges the use of threads, so this functionality maybe depercated in the future [0][1]

v2: adds the usethreads to native and nativesdk. This was tested by builing postresql and rrdtool which use perl and automake.

[0] https://perldoc.perl.org/5.34.0-RC2/threads#WARNING
[1] https://perldoc.perl.org/perlpolicy#discouraged

---
 meta/recipes-devtools/perl/perl_5.34.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/perl/perl_5.34.0.bb +2 -0
index a6ae80f07e1..e4bcfe3ce69 100644
@@ -53,6 +53,7 @@ do_configure:class-target() {
     ./configure --prefix=${prefix} --libdir=${libdir} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -80,6 +81,7 @@ do_configure:class-nativesdk() {
     ./configure --prefix=${prefix} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \

meta/recipes-devtools/perl/perl_5.34.0.bb do_configure:class-native() { · line 102

Quoted 7 lines
meta/recipes-devtools/perl/perl_5.34.0.bb +1 -0
@@ -94,6 +96,7 @@ do_configure:class-native() {
     ./configure --prefix=${prefix} \
     -Dbin=${bindir}/perl-native \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Ui_xlocale \

This patch seems to break perl-native with musl:

| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x8298): undefined reference to `PL_perldb'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x82a4): undefined reference to `PL_DBsingle'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x82b1): undefined reference to `PL_DBcontrol'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x82bf): undefined reference to `PL_initav'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x82d2): undefined reference to `PL_phase'
| /[...]/tmp/hosttools/ld: perlmini.o: in function `Perl_my_failure_exit':
| perlmini.c:(.text+0x831d): undefined reference to `PL_statusvalue'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x8336): undefined reference to `PL_exit_flags'
| /[...]/tmp/hosttools/ld: perlmini.o: in function `Perl_xs_boot_epilog':
| perlmini.c:(.text+0x83a7): undefined reference to `PL_unitcheckav'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x83b9): undefined reference to `PL_scopestack_ix'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x83c7): undefined reference to `PL_stack_base'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x83ce): undefined reference to `PL_sv_immortals'
| /[...]/tmp/hosttools/ld: perlmini.c:(.text+0x83e6): undefined reference to `PL_stack_sp'
| collect2: error: ld returned 1 exit status
| make[1]: *** [Makefile:99: miniperl] Error 1
| make[1]: Leaving directory '/[...]/tmp/work/x86_64-linux/perl-native/5.34.0-r0/perl-5.34.0'
| make: *** [Makefile:79: all] Error 2
| ERROR: oe_runmake failed
| WARNING: /[...]/work/x86_64-linux/perl-native/5.34.0-r0/temp/run.do_compile.685819:191 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
|       #1: bbfatal_log, /[...]/tmp/work/x86_64-linux/perl-native/5.34.0-r0/temp/run.do_compile.685819, line 191
|       #2: die, /[...]/tmp/work/x86_64-linux/perl-native/5.34.0-r0/temp/run.do_compile.685819, line 175
|       #3: oe_runmake, /[...]/tmp/work/x86_64-linux/perl-native/5.34.0-r0/temp/run.do_compile.685819, line 170
|       #4: do_compile, /[...]/tmp/work/x86_64-linux/perl-native/5.34.0-r0/temp/run.do_compile.685819, line 148
|       #5: main, /[...]/work/x86_64-linux/perl-native/5.34.0-r0/temp/run.do_compile.685819, line 195

Andrei

#2 lore raw
Quoted 48 lines · Andrei Gherzan

Hi,

Quoted 45 lines · Saul Wold

From: Saul Wold <[email protected]>

When the tranisiton to perl-cross occured, the threading define seems to have been missed. The perl tests for threading where simply skipped, so there was no direct failures. This was verified by running perl ptest before and after the change to see PASS vs SKIP results of threaded related tests.

NOTE: Perl officially discourges the use of threads, so this functionality maybe depercated in the future [0][1]

v2: adds the usethreads to native and nativesdk. This was tested by builing postresql and rrdtool which use perl and automake.

[0] https://perldoc.perl.org/5.34.0-RC2/threads#WARNING
[1] https://perldoc.perl.org/perlpolicy#discouraged

---
 meta/recipes-devtools/perl/perl_5.34.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/perl/perl_5.34.0.bb +2 -0
index a6ae80f07e1..e4bcfe3ce69 100644
@@ -53,6 +53,7 @@ do_configure:class-target() {
     ./configure --prefix=${prefix} --libdir=${libdir} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -80,6 +81,7 @@ do_configure:class-nativesdk() {
     ./configure --prefix=${prefix} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -94,6 +96,7 @@ do_configure:class-native() {
     ./configure --prefix=${prefix} \
Quoted 8 lines

meta/recipes-devtools/perl/perl_5.34.0.bb do_configure:class-native() { · line 102

Quoted 6 lines
meta/recipes-devtools/perl/perl_5.34.0.bb +1 -0
     -Dbin=${bindir}/perl-native \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Ui_xlocale \

This patch seems to break perl-native with musl:

It seems like it is persistent and it can be workaround-ed with a cleansstate. the way to reproduce (if anyone is interested) is to:
0. I've only tested it with musl so it might be musl specific
1. cleansstate perl-native
2. build without this patch - reverted
3. build with this patch

Andrei

#3 lore raw

You need to clean before every build. Perl doesn't correctly reconfigure itself when settings like this change.

Alex

Quoted 78 lines · Andrei Gherzan
Quoted 48 lines · Andrei Gherzan

Hi,

Quoted 45 lines · Saul Wold

From: Saul Wold <[email protected]>

When the tranisiton to perl-cross occured, the threading define seems to have been missed. The perl tests for threading where simply skipped, so there was no direct failures. This was verified by running perl ptest before and after the change to see PASS vs SKIP results of threaded related tests.

NOTE: Perl officially discourges the use of threads, so this functionality maybe depercated in the future [0][1]

v2: adds the usethreads to native and nativesdk. This was tested by builing postresql and rrdtool which use perl and automake.

[0] https://perldoc.perl.org/5.34.0-RC2/threads#WARNING
[1] https://perldoc.perl.org/perlpolicy#discouraged

---
 meta/recipes-devtools/perl/perl_5.34.0.bb | 3 +++
 1 file changed, 3 insertions(+)
meta/recipes-devtools/perl/perl_5.34.0.bb +2 -0
index a6ae80f07e1..e4bcfe3ce69 100644
@@ -53,6 +53,7 @@ do_configure:class-target() {
     ./configure --prefix=${prefix} --libdir=${libdir} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -80,6 +81,7 @@ do_configure:class-nativesdk() {
     ./configure --prefix=${prefix} \
     --target=${TARGET_SYS} \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
@@ -94,6 +96,7 @@ do_configure:class-native() {
     ./configure --prefix=${prefix} \
Quoted 8 lines

meta/recipes-devtools/perl/perl_5.34.0.bb do_configure:class-native() { · line 102

Quoted 6 lines
meta/recipes-devtools/perl/perl_5.34.0.bb +1 -0
     -Dbin=${bindir}/perl-native \
     -Duseshrplib \
+    -Dusethreads \
     -Dsoname=libperl.so.5 \
     -Dvendorprefix=${prefix} \
     -Ui_xlocale \

This patch seems to break perl-native with musl:

It seems like it is persistent and it can be workaround-ed with a cleansstate. the way to reproduce (if anyone is interested) is to:
0. I've only tested it with musl so it might be musl specific
1. cleansstate perl-native
2. build without this patch - reverted
3. build with this patch

Andrei

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#160347):
https://lists.openembedded.org/g/openembedded-core/message/160347
Mute This Topic: https://lists.openembedded.org/mt/88246693/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
Quoted 1 line · Alexander Kanavin

You need to clean before every build. Perl doesn't correctly reconfigure itself when settings like this change.

I'm not sure I get you here. Are you saying that this is normal behavior or that it is a known issue? If the latter, do we have an bug raised on it?

Andrei

#5 lore raw
Quoted 7 lines · Andrei Gherzan

You need to clean before every build. Perl doesn't correctly reconfigure itself when settings like this change.

I'm not sure I get you here. Are you saying that this is normal behavior or that it is a known issue? If the latter, do we have an bug raised on it?

Yes, it's something to be fixed, I'm just saying that the specific change itself is not the source of trouble.

Alex

#6 lore raw
Quoted 7 lines · Alexander Kanavin
Quoted 4 lines · Andrei Gherzan

You need to clean before every build. Perl doesn't correctly reconfigure itself when settings like this change.

I'm not sure I get you here. Are you saying that this is normal behavior or that it is a known issue? If the latter, do we have an bug raised on it?

Yes, it's something to be fixed, I'm just saying that the specific change itself is not the source of trouble.

That makes sense and after a bit more debugging it seems to match my testing as well.

Thanks,
Andrei