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

cross-compilation support

Thread Next
From:
Alexander Hartmaier
Date:
December 30, 2011 18:03
Subject:
cross-compilation support
Message ID:
CAB49Qrb2t1QdwfCOkxgEL2Dmy8ZLrV3m7vZrxO9zrEoFuR0b+Q@mail.gmail.com
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 README.new seem to be
outdated because they both don't mention the -Dusecrosscompile Configure
option).
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)

[1]
http://sourceforge.net/projects/dsgpl/files/DSM%203.2%20Tool%20Chains/Marvell%2088F628x%20Linux%202.6.32/

[2]
./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 \
    -des

[3]
abraxxa@abraxxa-pc:~/Dokumente/synology-nas/perl-5.14.2$ make
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh ./miniperl
-Ilib autodoc.pl
/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
-Ilib make_patchnum.pl
Reusing 'git_version.h' and 'lib/Config_git.pl'
/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 make_ext.pl cpan/Archive-Extract/pm_to_blib MAKE=make
LIBPERL_A=libperl.a
    Making Archive::Extract (all)

Running Makefile.PL in cpan/Archive-Extract
/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh
../../miniperl -I../../lib Makefile.PL INSTALLDIRS=perl INSTALLMAN1DIR=none
INSTALLMAN3DIR=none PERL_CORE=1 LIBPERL_A=libperl.a
Can't exec
"/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh": No such
file or directory at make_ext.pl line 403.
-1 from cpan/Archive-Extract's Makefile.PL at make_ext.pl 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 make_ext.pl 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
PERL_CORE=1 LIBPERL_A=libperl.a
Can't exec
"/home/abraxxa/Dokumente/synology-nas/perl-5.14.2/Cross/run-ssh": No such
file or directory at make_ext.pl line 462.
Unsuccessful make(cpan/Archive-Extract): code=-1 at make_ext.pl line 463.
make: *** [cpan/Archive-Extract/pm_to_blib] Fehler 2

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About