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:// . 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:

Built multiarch-perl packages for ubuntu raring can be found in deb 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 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: 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:

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

 /usr/bin/make all PERL_CORE=1 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/' for module File::Glob: ../../../lib/auto/File/Glob/ cannot open shared object file: No such file or directory at ../../../lib/ line 71.
 at ../../../lib/File/ line 59
Compilation failed in require at ../../../lib/ExtUtils/ line 90.

A full build log is here