We have to maintain a number of patches to cross compile Perl. However there does exist a perl-cross overlay to cross compile Perl that is used by buildroot and others: https://github.com/arsv/perl-cross https://git.busybox.net/buildroot/tree/package/perl/perl.mk Sharing this would mean we have to maintain less ourselves.
I've started working on this; initial results are rather promising: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=akanavin/perl-sanity
So the current situation with the branch is that the new perl recipe builds without errors or warnings (in all three variants - native, target, nativesdk), and perl modules are split into packages in a reasonable sane way. The commit history is a mess, I know, and needs to be reworked. There are however a few build failures: Summary: 12 tasks failed: virtual:native:/home/ak/development/poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.9.bb:do_compile /home/ak/development/poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb:do_configure /home/ak/development/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb:do_configure /home/ak/development/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb:do_configure /home/ak/development/poky/meta/recipes-extended/perl/libxml-sax-perl_1.00.bb:do_configure /home/ak/development/poky/meta/recipes-devtools/perl/libtest-needs-perl_0.002005.bb:do_configure /home/ak/development/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb:do_configure /home/ak/development/poky/meta/recipes-devtools/perl/liberror-perl_0.17025.bb:do_configure /home/ak/development/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb:do_configure /home/ak/development/poky/meta/recipes-devtools/perl/liburi-perl_1.74.bb:do_configure /home/ak/development/poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb:do_prepare_recipe_sysroot /home/ak/development/poky/meta/recipes-devtools/git/git_2.16.1.bb:do_install and whether perl works on target isn't tested either. As I'm about to switch jobs and countries I thought this is a good point to take a pause, hopefully this work can be completed later :)
This has been merged to oe-core master :)