Open berolinux opened 2 months ago
Can you post config.log and config.sh from the failing build?
Looks like it mis-detects something about threads on the target.
Same here from x86_64-linux-gnu to m68k-linux-gnu on Gentoo. 5.38.2 still builds fine, so I don't think it's a Gentoo issue.
It seems this is a general issue. Do not apply
cnf/diffs/perl5-5.40.0/xconfig.patch
fix the linker errors for (all?) cross-compilation combinations. Tested with x86_64-linux-gnu to {aarch64,loongarch64,powerpc64le,riscv64}-linux-gnu so far.
s390x then fails with different errors. But this may be an other issue.
That xconfig.h patch must be either applied everywhere, or not applied anywhere (but that would defeat its whole purpose — do at your own risk).
Normally config.h is only included via perl.h, which is patched, but in 5.40, locale.c also includes config.h directly and must be patched as well. Without that, you end up with most of miniperl built using xconfig.h but with locale.c built using config.h instead. And it fails to link then.
Pushed a fix, try it if possible.
Now this issue should be 100% reproducible, but it's not, for me at least, so I might be missing something else.
Confirmed that 36279737fc04559c10a2c1017b58ccc1ce59d233 fixes it for me.
Trying to crosscompile perl 5.40.0 from x86_64-linux-gnu to riscv64-linux-gnu with perl-cross 1.5.3 results in
while linking the host miniperl.
Native x86_64-linux-gnu builds of perl 5.40.0 compile and work fine on the same box.