develooper Front page | perl.perl5.porters | Postings from January 2013

Re: Cross-building and Makefile.SH

Thread Previous | Thread Next
Neil Williams
January 11, 2013 17:55
Re: Cross-building and Makefile.SH
Message ID:
On Tue, 08 Jan 2013 09:52:55 -0000
"Jess Robinson" <> wrote:

> >> > I do get an amd64 host/miniperl with these options:
> >> >
> >> > LINE="-Dusecrosscompile -Dcrosscompileprefix=arm-linux-gnueabi"
> >> > LINE=" ${LINE} -Dcc=arm-linux-gnueabi-gcc "
> >> > LINE=" ${LINE} -Dtargetarch=armel -Dusedevel -Des -d"
> >> > ./Configure ${LINE}
> >>
> >> For the record my current options are: ./Configure -des -Dusedevel
> >> -Dusecrosscompile -Dtargethost="emulator-5554"  
> >> -Dtargetdir=/data/data/test
> >> -Dsysroot=/usr/src/android/android-ndk-r8/platforms/android-8/arch-arm/
> >> -Dcc=arm-linux-androideabi-gcc linux

That's where I got the extra "linux" part of that command line...

Removed now.

> > I should have some time to investigate further later in the week.
> Thanks Neil, that's a bit odd. Did your previous, which gets  
> loaded *after* hostperl and hostgenerate are set, already have empty  
> values in for hostperl, hostgenerate? Try removing the first?  
> This is probably also the reason that your CC value is not being used/set.
> I should try and move the actual setting of these until after is  
> loaded.
> I also notice you have an extra "linux" in your Configure options:
> LINE="-des -Dusedevel -Dusecrosscompile "
> LINE=" ${LINE} -Dcc=arm-linux-gnueabi-gcc linux"  <---
> LINE=" ${LINE} -Dtargetarch=armel -Dtargethost=\"armel\""

targethost was confusing me for a while. Whilst some tests are done
with an armel cross compiler, my main interest is in how to get the
config data files to cross-compile perl for new architectures like arm64
where there is no emulator, only a model which doesn't do things like
ssh particularly well. In my case, the model is currently also running
OpenEmbedded, so some of the extension configuration is going to differ
too. A way to skip certain stages of Configure is going to be
necessary, maybe if usecrosscompile is defined and targethost is *not*.

Now that I'm actually getting cross compilation in the branch, the
Configure stage is (predictably) halting at the point where it tries to
either use a remote connection or to execute cross-compiled binaries

I understand the need to run Configure tests to generate the data but I
think there should also be a way to skip the actual execution of any
compiled binaries when cross compiling. If the resulting binaries can
be executed on the build machine, there seems little point using a
cross-compilation method to obtain them.

perl-cross-debian works by avoiding Configure completely due to changes
in the Debian build system which simply avoid calling it. It may be
best that in the exact situation that usecrosscompile is set but
targethost is not, that Configure then assumes that config.h,
and whatever generated headers it would have written are effectively
read-only and it should just pretend that configuration is ok and
complete. Currently, it croaks and fails. I've forked your git repo on
github and committed some changes there to cover that eventuality.

The github pull request seems to be claiming the wrong stats - if it's
easier, just close that and copy over the commits.

I can make changes to perl-cross-debian to chain on from that point,
using the miniperl in host/ and config files gleaned from other tests.

Allowing builds to continue when targethost is not set but
usecrosscompile is set also means that builds of the same version can
be reproduced using cross compilers without access to real hardware.

> Which is maybe why the targethost value is ignored, see "No targethost for  
> running compiler tests against defined, running locally" in the log. Note  
> that targethost is currently "a remote server/host to run small Configure  
> tests on" in my branch. I should probably rename it to "buildhost" for  
> less confusion.

... or even configurehost ?

With my local changes, I now have a host/miniperl I can use and I'm
going to move on to using targethost for armhf so that I can get
updated config files for perl-cross-debian to use with 5.17, at which
point I can do a full cross-build for armhf. (I have an armhf board
which will be able to provide sane results via SSH, it's arm64 which
I can't easily configure in this way.)

Currently, I don't have a suitable config.h for 5.17, so the armel cross
build fails due to undefined macros in config.h - that's fixable once I
have the armhf files.

I've updated the output files:


Neil Williams

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