I'm not sure if my theory is correct, but I strongly suspect there's a problem in (lack of) flags to set the stdlib.
Perl devs pointed me to:
try https://metacpan.org/pod/ExtUtils::MakeMaker#PERL_MM_OPT for EUMM installers
and https://metacpan.org/pod/Module::Build#PERL_MB_OPT for M::B installers
the latter is also honored by Module::Build::Tiny https://metacpan.org/pod/Module::Build::Tiny#CONFIG-FILE-AND-ENVIRONMENT
Maybe the perl PortGroup could always set the stdlib in the PERL_MM_OPT
and PERL_MB_OPT
environmental variables. Untested theory.
I fail to understand why exactly the universal build would fix the issue, but it could be that one module is not installed as i386 and then the package being built would link against perl5.24 rather than against another existing p5.24-*
module and this would work (since perl was built with the right flags).
The mutex
keyword smells like C++11 in any case.