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

Re: Question on porting perl 5.16 to Android (no /bin/sh)

Thread Previous | Thread Next
From:
Ben Greear
Date:
September 9, 2013 19:01
Subject:
Re: Question on porting perl 5.16 to Android (no /bin/sh)
Message ID:
522E1B15.8060202@candelatech.com
On 09/09/2013 11:54 AM, Brian Fraser wrote:
> On Thu, Sep 5, 2013 at 1:23 PM, Ben Greear <greearb@candelatech.com <mailto:greearb@candelatech.com>> wrote:
>
>     On 09/05/2013 08:52 AM, Brian Fraser wrote:
>
>         On Thu, Sep 5, 2013 at 2:23 AM, Ben Greear <greearb@candelatech.com <mailto:greearb@candelatech.com> <mailto:greearb@candelatech.__com
>         <mailto:greearb@candelatech.com>>> wrote:
>
>
>              A simple test to make sure it handles `complex shell comman` works, but in a more advanced
>              script, I'm getting this error:
>
>              Can't load '/data/data/candela.lanforge//____local/lib/perl5/5.18.0/__linux-__androideabi/auto/__Fcntl/Perl___Fcntl.so' for module Fcntl: dlopen
>         failed: cannot
>              locate symbol "Perl_stack_grow" referenced by "Perl_Fcntl.so"... at /data/data/candela.lanforge//____local/lib/perl5/5.18.0/____XSLoader.pm line 69.
>                at /data/data/candela.lanforge//____local/lib/perl5/5.18.0/linux-____androideabi/Fcntl.pm line 66.
>              Compilation failed in require at /data/data/candela.lanforge//____local/lib/perl5/5.18.0/linux-____androideabi/POSIX.pm line 11.
>              BEGIN failed--compilation aborted at /data/data/candela.lanforge//____local/lib/perl5/5.18.0/linux-____androideabi/POSIX.pm line 17.
>
>
>
>         Stab in the dark, did you perhaps forget to run the
>
>         perl -i -wlnpe "s{^libpth=\K.+}{'/tmp/__tmpandroidlib'}" config.sh
>
>
>     That was not the problem.
>
>
>
>         Line after configure but before running make?
>
>         If not, I'm a tad stumped. You can try setting LD_LIBRARY_PATH to something relevant, like pointing at the CORE directory, or try building a shared perl
>         (more
>         on that in a moment)
>
>
>              I noticed that there is a ...../CORE/libperl.a file, but there is no libperl.so anywhere to be found
>              in the install directory.
>
>              On the older perl I tried from the perldroid project there was a libperl.so in the CORE directory.
>
>              Do I actually need the libperl.so to be created somehow or is that symbol supposed
>              to be located elsewhere?
>
>
>         By default, perl builds a static perl, so this should be fine, but you can try building a shared libperl by running Configure with
>
>         -Uuserelocatableinc -Duseshrplib
>         And checking if that works any differently? You'll have to set both LD_LIBRARY_PATH and PERL5LIB to use that, though.
>
>
>     Building shared did fix the problem.  I've yet more testing to complete, but so far
>     it seems OK.  In case anyone else tries this, here are my notes.  I think these
>     are free of typos, but I'll need to do another full build from clean repository
>     to know for sure.
>
>
> Awesome! Thanks for the notes and for trying things out. Congrats on your shiny new perl, too :D Tangentially related, could you check your device's android
> version? I want to try reproducing & fixing the error you got with static libraries, since those really ought to be working everywhere.

It's a 'Nexus 4'.  It has been rooted, and I installed the update that was automatically
pushed over the air, but aside from that it was stock when I started on it..

> And if you have the time, seeing if you can reproduce the error with the android emulator would be pretty helpful in narrowing this down -- it might be that
> Configure is picking things "right" in my ubuntu and mac, but gets confused in Fedora somehow.
> ...Or maybe it's yet another android linker fun to work around.

Might be a bit before I can get back to this porting effort.

I suspect that removing the config.sh and Policy.sh before doing any testing
would be the biggest help.  Nothing is reliably reproducible without that
from what I can tell, since many of the options you might give to configure
are either ignored outright or have different effects since previous defaults
were set differently.

At least in my opinion, that behaviour from Configure is a bug.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


Thread Previous | 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