Multiarching Perl

Perl has both arch-specific libraries and an arch-independent language interpreter. Perl modules can be arch independent or they can be linked to arch-dependent C code. This means that perl has to be treated carefully to work nicely with Multiarch.

This page tracks the process until it is agreed and upstreamed.

The main discussion thread is on the debian-perl mailing list

Niko Tyni did the work to implement the initial set-up discussed in that thread. That lives in the 'ntyni/multiarch-5.14' of git://git.debian.org/perl/perl.git . That version currently (Feb 2013) stands at perl 5.14.2-13. Meanwhile perl in unstable has moved on to 5.14.2-18.

A patch to add multiarchness to 5.14.2-18 is here: http://wookware.org/software/patches/perl-5.14.2-18-multiarch.patch

Built multiarch-perl packages for ubuntu raring can be found in deb http://people.debian.org/~wookey/bootstrap/ubunturepo/ raring-bootstrap main universe

This all seems to work nicely, building XS packages and working as a perl interpreter. However there is some esoteric discussion in that thread about possible issues with upgrades and ABIs - it'll become clearer over time whether there is really an issue there.

Crossbuilding Multiarch perl

For bootstrapping and general cross-friendliness we also need to be able to crossbuild perl. The perl config system is based on a native config-generation step which is not cross-friendly. To cross-build it a pre-prepared config file is needed. The perl-cross-debian package exists as a helper to supply the necessary configs (differrent for each architecture and perl version).

This support works fine on the unstable and raring perl package.

The perl source in the raring-bootstrap repo crossbuilds multiarch perl, but the resulting package has an unstripped libperl.so and arch-independent files (.pm, .xi) and the config*.pm files are missing from the libperl5.14 package produced. The package in the repo has been manually fixed up. The compiled in @INC path is also wrong. That source can also be found at: http://linux.codehelp.co.uk/emdebian/perl-cross-debian/perl_5.14.2-18ma1.dsc The build-log for that package is here

Some updates to get that working correctly with xapt/dpkg-cross style cross builds have since gone into perl-cross-debian, but the multiarch cross-build still has issues (as of 2013-02-26)

---

Here is my (Wookey's) slightly earlier attempt (work-in-progress) patch to merge the cross-building and multiarch support so we can have both working at once: http://wookware.org/software/patches/perl-5.14.2-18-ma-cross-3.patch

This currently falls over trying to load the wrong-arch (aarch64) glob module:

 /usr/bin/make all PERL_CORE=1 LIBPERL_A=libperl.so.5.14.2 LINKTYPE=dynamic
make[3]: Entering directory `/home/wookey/ubuntu/raring/perl-5.14.2-ma-cross/ext/SDBM_File'
make[4]: Entering directory `/home/wookey/ubuntu/raring/perl-5.14.2-ma-cross/ext/SDBM_File/sdbm'
Can't load '../../../lib/auto/File/Glob/Glob.so' for module File::Glob: ../../../lib/auto/File/Glob/Glob.so: cannot open shared object file: No such file or directory at ../../../lib/XSLoader.pm line 71.
 at ../../../lib/File/Glob.pm line 59
Compilation failed in require at ../../../lib/ExtUtils/Command.pm line 90.

A full build log is here