develooper Front page | perl.perl5.porters | Postings from December 2011

cross-compilation support

Thread Next
Alexander Hartmaier
December 30, 2011 18:03
cross-compilation support
Message ID:
Hi p5p,
I've tried to cross-compile 5.14.2 and 5.15.6 under Ubuntu 11.10 x64 for my
Synology NAS DS211j which is an ARM platform and ships with Perl 5.8.4 but
without a compiler.
Synology provides an sdk on Sourceforge [1] which includes documentation.
While searching on the Internet I discovered that Perl is different than
the example from the sdk documentation and needs access to the target
host/platform (the information in Cross/README and seem to be
outdated because they both don't mention the -Dusecrosscompile Configure
Configure [2] failed because it creates multiple little pieces of C code
that get compiled and copied to the target host for execution, most of the
time named 'try'.
The run code includes a check for a local $filename.xok file that is
created after a successful copy to the target but never deleted which leads
to the first binary named 'try' on the target host to never get overwritten
and used for every test.
I fixed it for now by disabling the $filename.xok check.
This allowed Configure to finished its task.
make complained about not finding the xconfig.h file which I solved by
renaming the generated config.h, which seems to get created under the wrong
name for cross-compilation.
The next few failures occurred because some files didn't get copied to the
target host which I fixed by copying the whole perl dir to it.
I'm not sure if those steps should even run on the target host but on the
host that has the compiler.
Below [3] is the end of the make output of how far I've got.

Nick Clark encouraged me this evening to write to the list to get help and
a possible long-term fix.
It would be helpful for me if there where docs that describe how
cross-compilation is suppossed to work to be able to spot errors.
Do they exist and I missed them?

Best regards, Alex (abraxxa on CPAN)


./Configure \
    -Dusecrosscompile \
    -Dtargethost=abraxxa-nas \
    -Dtargetuser=abraxxa \
    -Dtargetdir=/volume1/homes/abraxxa/perl \
    -Dtargetarch=arm-linux \
    -Dcc=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc \
    -Dusrinc=/usr/local/arm-none-linux-gnueabi/include \
    -Dincpth=/usr/local/arm-none-linux-gnueabi/include \
    -Dlibpth=/usr/local/arm-none-linux-gnueabi/lib \
    -Duselargefiles \
    -Duserelocatableinc \

abraxxa@abraxxa-pc:~/Dokumente/synology-nas/perl-5.14.2$ make
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh ./miniperl
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh ./miniperl
-Ilib -Idist/Cwd -Idist/Cwd/lib pod/perlmodlib.PL -q
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh ./miniperl
Reusing 'git_version.h' and 'lib/'
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh ./miniperl
-Ilib configpm
written lib/Config.pod
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh ./miniperl
-Ilib cpan/Archive-Extract/pm_to_blib MAKE=make
    Making Archive::Extract (all)

Running Makefile.PL in cpan/Archive-Extract
../../miniperl -I../../lib Makefile.PL INSTALLDIRS=perl INSTALLMAN1DIR=none
Can't exec
"/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh": No such
file or directory at line 403.
-1 from cpan/Archive-Extract's Makefile.PL at line 404.
Warning: No Makefile!
Can't exec
"/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh": No such
file or directory at line 457.
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh make config
PERL_CORE=1 LIBPERL_A=libperl.a failed, continuing anyway...
Making all in cpan/Archive-Extract
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh make all
Can't exec
"/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh": No such
file or directory at line 462.
Unsuccessful make(cpan/Archive-Extract): code=-1 at line 463.
make: *** [cpan/Archive-Extract/pm_to_blib] Fehler 2

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About