Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jrobinson/configure for cross #3

Open
wants to merge 58 commits into
base: jrobinson/configure-for-cross
Choose a base branch
from
Open

Jrobinson/configure for cross #3

wants to merge 58 commits into from

Conversation

Hugmeir
Copy link

@Hugmeir Hugmeir commented Aug 9, 2013

The long awaited(?) pull request! I've tweaked things a bit so that commits that touch dist/, ext/, and cpan/ are at the "top" (the terminology escapes me), so you can merge just the important stuff and leave those out if it makes your life easier.
The very last commit touches Configure itself, so it definitely should not be merged. Also, I've left out the changes to make cross compilation work on a Mac host, because that's not quite working yet.

Hugmeir added 30 commits May 20, 2013 08:10
This is primarily to get the tests working. open($fh, undef) calls
PerlIO_tmpfile(), which requires either /tmp to exist or $ENV{TMPDIR}
to be set.  In Android, neither of those is true.

A possible fix would be to have PerlIO_tmpfile() behave like File::Temp
and just try the cwd; the "real" fix would require calling java
at startup to get Context.getCacheDir.
Bionic implements several functions as stumps that simply warn
and return null, which leads to situations like this:

FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:378

This commit introduces some probes for functions (getnetbyname,
getnetbyaddr, getmntent, getprotobyname, getprotobynumber, endpwent,
ttyname) that we use and are actually stubs in at least some
versions of Android.
If we find a stub, we pretend that the function is undefined, so
the above example becomes this:

Unsupported socket function "getprotobyname" called at -e line 1.

Note that this commit does not fix the modules that assume that
these functions are always available, so 'make test' still fails.
Android's linker has some unusual behavior, in that it only uses
the basename of a library in its cache.  That means that, as far as
dlopen() is concerned, the libraries for Hash::Util and List::Util,
both of which are called Util.so, are the same.

This commit teaches ExtUtils::MM_Unix about d_libname_unique.  When
defined, it signals MakeMaker to rename the .so files to something
"unique" -- so for example, Hash/Util/Util.so becomes
Hash/Util/Perl_Hash_Util.so.
If a platform has getppid() but not getconf and we're building a
threaded perl, this file would've shown undef warnings, although
no tests were affected.
Hugmeir added 28 commits August 9, 2013 03:07
This is generally a non-issue, however, if /tmp doesn't exist
and $ENV{TMPDIR} isn't set, ->tmpdir() used to return ".", which
broke the following pattern:

    use File::Temp qw(tempdir);
    use File::Spec;
    my $tmpdir = tempdir(CLEANUP => 1);
    chdir $tmpdir;
    my $file = File::Spec->catfile($tmpdir, "foo");
    open my $fh, ">", $file or die $!;

Because $tmpdir would be something like 'bfhskjf94589', and after
the chdir, the open() would've tried to open $tmpdir/$tmpdir/foo.
On Android, all locales are simply disabled, which broke the assumption
that LC_TIME is always available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant