From 62c0632914a54e810eba6e54c6f1e18622fa47ee Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 24 Apr 2013 00:51:20 -0300 Subject: [PATCH 01/58] Fix the SKIP for android in t/run/fresh_perl.t --- t/run/fresh_perl.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/run/fresh_perl.t b/t/run/fresh_perl.t index c5eced61a36..305509f3ae6 100644 --- a/t/run/fresh_perl.t +++ b/t/run/fresh_perl.t @@ -757,7 +757,7 @@ $_="foo";utf8::upgrade($_);/bar/i,warn$_; EXPECT foo at - line 1. ######## glob() bug Mon, 01 Sep 2003 02:25:41 -0700 <200309010925.h819Pf0X011457@smtp3.ActiveState.com> -# SKIP "glob() works on Android, but this test doesn't" if($^O eq 'linux-androideabi'); +# SKIP: "glob() works on Android, but this test doesn't" if($^O eq 'linux-androideabi'); -lw # Make sure the presence of the CORE::GLOBAL::glob typeglob does not affect # whether File::Glob::csh_glob is called. From 98da9eb92776e9086c50b874b8aa461dc7fecfa4 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 24 Apr 2013 01:09:42 -0300 Subject: [PATCH 02/58] t/op/incfilter.t: Work around android only having an inbuilt echo --- t/op/incfilter.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/op/incfilter.t b/t/op/incfilter.t index 6227c4ac371..efa0089470a 100644 --- a/t/op/incfilter.t +++ b/t/op/incfilter.t @@ -74,7 +74,12 @@ if ($^O eq 'VMS') { $fail_arg = '"fail"'; } else { - $echo_command = 'echo'; + if ($^O eq 'linux-androideabi') { + $echo_command = q{sh -c 'echo $@' -- }; + } + else { + $echo_command = 'echo'; + } $pass_arg = 'pass'; $fail_arg = 'fail'; } From b05ed0b3803b03e2b42c3e7157df4405f22d900d Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 24 Apr 2013 02:28:12 -0300 Subject: [PATCH 03/58] t/op/magic.t: Work around android only having an inbuilt pwd --- t/op/magic.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/t/op/magic.t b/t/op/magic.t index d4e9ee40415..8d4df5498b7 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -273,8 +273,13 @@ $$ = $pid; # Tests below use $$ chomp($wd = `/usr/bin/fullpath -t`); } elsif(($Is_Cygwin && !$Is_Android) || $is_abs) { - # Cygwin turns the symlink into the real file - chomp($wd = `pwd`); + if ( $Is_Android ) { + chomp($wd = `sh -c 'pwd'`); + } + else { + # Cygwin turns the symlink into the real file + chomp($wd = `pwd`); + } $wd =~ s#/t$##; $wd =~ /(.*)/; $wd = $1; # untaint if ($Is_Cygwin) { From 7ab3c368faf531a1c17258787b38d1953be8dd9a Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 24 Apr 2013 15:14:14 -0300 Subject: [PATCH 04/58] Makefile.SH: on make test_prep, add $target/lib:$target/lib/auto to -env LD_LIBRARY_PATH=... --- Makefile.SH | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.SH b/Makefile.SH index b89c9182078..cbdfeddd414 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -1541,7 +1541,7 @@ test check: test_prep *) $spitshell >>$Makefile < Date: Wed, 24 Apr 2013 19:01:04 -0300 Subject: [PATCH 05/58] t/lib/warnings/pp_sys: Add skips in case telldir is not available --- t/lib/warnings/pp_sys | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/t/lib/warnings/pp_sys b/t/lib/warnings/pp_sys index f0a56275a2d..50ac44038ed 100644 --- a/t/lib/warnings/pp_sys +++ b/t/lib/warnings/pp_sys @@ -807,6 +807,17 @@ Opening filehandle FOO also as a directory at - line 9. Opening filehandle $foo also as a directory at - line 10. ######## # pp_sys.c [pp_*dir] +use Config ; +BEGIN { + if ( ! $Config{d_telldir}) { + print < Date: Wed, 24 Apr 2013 19:07:44 -0300 Subject: [PATCH 06/58] t/op/fork.t: Work around android only having an inbuilt echo --- t/op/fork.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/op/fork.t b/t/op/fork.t index fbaf3327a25..a9aa8ed9797 100644 --- a/t/op/fork.t +++ b/t/op/fork.t @@ -288,6 +288,9 @@ parent got 10752 $| = 1; $\ = "\n"; my $echo = 'echo'; +if ($^O eq 'linux-androideabi') { + $echo = q{sh -c 'echo $@' -- }; +} if ($pid = fork) { waitpid($pid,0); print "parent got $?" From f7536a3243e2d0adb2b61f9fe6778efc4fbd75b9 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 24 Apr 2013 19:08:21 -0300 Subject: [PATCH 07/58] t/op/fork.t: Up the sleep time in a test to avoid timing issues --- t/op/fork.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/op/fork.t b/t/op/fork.t index a9aa8ed9797..95147dd2d01 100644 --- a/t/op/fork.t +++ b/t/op/fork.t @@ -494,7 +494,7 @@ if (my $pid = fork) { } else { $SIG{TERM} = sub { print "2\n" }; - sleep 3; + sleep 10; print "3\n"; } EXPECT From 862723e560ce3a620c58dcae4d47b1fe27189ec4 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 24 Apr 2013 19:58:33 -0300 Subject: [PATCH 08/58] t/op/stat.t: use 'ls -l' on android, even if d_readlink is defined --- t/op/stat.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/op/stat.t b/t/op/stat.t index c5c74ca26c5..db7a8513754 100644 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -38,6 +38,7 @@ $Is_Solaris = $^O eq 'solaris'; $Is_VMS = $^O eq 'VMS'; $Is_DGUX = $^O eq 'dgux'; $Is_MPRAS = $^O =~ /svr4/ && -f '/etc/.relid'; +$Is_Android = $^O eq 'linux-androideabi'; $Is_Dosish = $Is_Dos || $Is_OS2 || $Is_MSWin32 || $Is_NetWare; @@ -251,7 +252,7 @@ SKIP: { if $Is_VMS; delete $ENV{CLICOLOR_FORCE}; - my $LS = $Config{d_readlink} ? "ls -lL" : "ls -l"; + my $LS = $Config{d_readlink} && !$Is_Android ? "ls -lL" : "ls -l"; my $CMD = "$LS /dev 2>/dev/null"; my $DEV = qx($CMD); From cd9bf2e98caa528614adaa0410b51c8c52d85a78 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Thu, 25 Apr 2013 13:46:09 -0300 Subject: [PATCH 09/58] t/op/sigdispatch.t: Increase timeout to avoid issues on slow processors --- t/op/sigdispatch.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/op/sigdispatch.t b/t/op/sigdispatch.t index f0add107bf0..7e08674ed74 100644 --- a/t/op/sigdispatch.t +++ b/t/op/sigdispatch.t @@ -12,7 +12,7 @@ use Config; plan tests => 29; $| = 1; -watchdog(15); +watchdog(25); $SIG{ALRM} = sub { die "Alarm!\n"; From fef54c33dfae1dea4433fc3f792032d905040d24 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Thu, 25 Apr 2013 13:48:11 -0300 Subject: [PATCH 10/58] hints/linux-androideabi.sh: use randfunc=random and randbits=31 --- hints/linux-androideabi.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hints/linux-androideabi.sh b/hints/linux-androideabi.sh index de445369ec0..ec0b59fcdb2 100644 --- a/hints/linux-androideabi.sh +++ b/hints/linux-androideabi.sh @@ -6,6 +6,10 @@ userelocatableinc='define' # On Android the shell is /system/bin/sh: targetsh='/system/bin/sh' +# On some devices drand48 isn't functional +randfunc='random' +randbits='31' + # Down with locales! # https://github.com/android/platform_bionic/blob/master/libc/CAVEATS d_locconv='undef' From 98285ba176a1d4c3d0cff1b442ddd8c2c8ca9b8e Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Thu, 25 Apr 2013 22:07:45 -0300 Subject: [PATCH 11/58] On Android, set $ENV{TMPDIR} on the tests for open($fh, undef) 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. --- dist/IO/t/io_xs.t | 6 +++++- pod/perlport.pod | 6 ++++++ t/io/perlio.t | 7 +++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dist/IO/t/io_xs.t b/dist/IO/t/io_xs.t index b73144794fe..4819ba02713 100644 --- a/dist/IO/t/io_xs.t +++ b/dist/IO/t/io_xs.t @@ -15,10 +15,14 @@ BEGIN { } } -use Test::More tests => 5; +use Test::More; use IO::File; use IO::Seekable; +local $ENV{TMPDIR} = '.' if($^O eq 'linux-androideabi'); + +plan(tests => 5); + $x = new_tmpfile IO::File; ok($x, "new_tmpfile"); print $x "ok 2\n"; diff --git a/pod/perlport.pod b/pod/perlport.pod index cdde52db3cb..0ab892f76fa 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1854,6 +1854,12 @@ open to C<|-> and C<-|> are unsupported. (Win32, S) Opening a process does not automatically flush output handles on some platforms. (SunOS, Solaris, HP-UX) +While you may use open with undef as the filename to create a temporary +file, this is unreliable, as a system may not have a /tmp directory or +equivalent, and have no $ENV{TMPDIR} set. Consider using File::Temp +instead. Alternatively, you could explicitly set $ENV{TMPDIR} before +calling open. (Android) + =item readlink Not implemented. (Win32, VMS, S) diff --git a/t/io/perlio.t b/t/io/perlio.t index 290cee7eb6d..3f74c95cebd 100644 --- a/t/io/perlio.t +++ b/t/io/perlio.t @@ -70,8 +70,8 @@ ok(close($utffh)); # magic temporary file via 3 arg open with undef { -SKIP: { - skip "No magic temp files on Android, no /tmp", 7 if($^O eq 'linux-androideabi'); +{ + local $ENV{TMPDIR} = '.' if($^O eq 'linux-androideabi'); ok( open(my $x,"+<",undef), 'magic temp file via 3 arg open with undef'); ok( defined fileno($x), ' fileno' ); @@ -91,8 +91,7 @@ SKIP: { # report after STDOUT is restored ok($status, ' re-open STDOUT'); close OLDOUT; - } - +} SKIP: { skip("TMPDIR not honored on this platform", 4) if !$Config{d_mkstemp} From 6d8b1b188b5b9d28b1140623485247fb13798872 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Fri, 26 Apr 2013 02:24:14 -0300 Subject: [PATCH 12/58] perlio.c, PerlIO_tmpfile: Fall back to cwd if we have no /tmp or TMPDIR --- perlio.c | 8 ++++++++ pod/perlport.pod | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/perlio.c b/perlio.c index 407d5db17d2..8187e564d93 100644 --- a/perlio.c +++ b/perlio.c @@ -5033,6 +5033,14 @@ PerlIO_tmpfile(void) /* else we try /tmp */ fd = mkstemp(tempname); } + if (fd < 0) { + /* Try cwd */ + if ( sv ) + SvREFCNT_dec(sv); + sv = newSVpvs("."); + sv_catpv(sv, tempname + 4); + fd = mkstemp(SvPVX(sv)); + } if (fd >= 0) { f = PerlIO_fdopen(fd, "w+"); if (f) diff --git a/pod/perlport.pod b/pod/perlport.pod index 0ab892f76fa..902092c1954 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1858,7 +1858,8 @@ While you may use open with undef as the filename to create a temporary file, this is unreliable, as a system may not have a /tmp directory or equivalent, and have no $ENV{TMPDIR} set. Consider using File::Temp instead. Alternatively, you could explicitly set $ENV{TMPDIR} before -calling open. (Android) +calling open. If neither TMPDIR nor /tmp exist, the current directory +is used. (Android) =item readlink From b7276168585aa0712c93920c01e29d11c5d9b1ee Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Sat, 27 Apr 2013 21:01:44 -0300 Subject: [PATCH 13/58] Android hints: Detect stub functions and mark them as undefined. 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. --- hints/linux-androideabi.sh | 96 +++++++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 2 deletions(-) diff --git a/hints/linux-androideabi.sh b/hints/linux-androideabi.sh index ec0b59fcdb2..8448becaf2e 100644 --- a/hints/linux-androideabi.sh +++ b/hints/linux-androideabi.sh @@ -19,7 +19,99 @@ i_locale='undef' # Default to USE_SHELL_ALWAYS d_useshellcmds='define' -d_libname_unique='define' + +# Bionic defines several stubs that just warn and return NULL +# https://gitorious.org/0xdroid/bionic/blobs/70b2ef0ec89a9c9d4c2d4bcab728a0e72bafb18e/libc/bionic/stubs.c +# https://android.googlesource.com/platform/bionic/+/master/libc/bionic/stubs.cpp + +# If they warn with 'FIX' or 'Android', assume they are the stubs +# we want to avoid. + +# These are all stubs as well, but the core doesn't use them: +# getusershell setusershell endusershell + +# This script UU/archname.cbu will get 'called-back' by Configure. +cat > UU/archname.cbu <<'EOCBU' +# egrep pattern to detect a stub warning on Android. +# Right now we're checking for: +# Android 2.x: FIX ME! implement FUNC +# Android 4.x: FUNC is not implemented on Android +android_stub='FIX|Android' + +cat > try.c << 'EOM' +#include +int main() { (void) getnetbyname("foo"); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getnbyname="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) getnetbyaddr((uint32_t)1, AF_INET); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getnbyaddr="$undef" +fi + +cat > try.c << 'EOM' +#include +#include +#include +int main() { (void) getmntent(stdout); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getmntent="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) getprotobyname("foo"); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getpbyname="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) getprotobynumber(1); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getpbynumber="$undef" +fi + +cat > try.c << 'EOM' +#include +#include +int main() { endpwent(); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_endpwent="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) ttyname(STDIN_FILENO); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_ttyname="$undef" +fi + +EOCBU case "$src" in /*) run=$src/Cross/run @@ -79,7 +171,7 @@ $from output.stdout $from output.stderr result=\`cat output.stdout\` result_err=\`cat output.stderr\` -rm output.stdout +rm output.stdout output.stderr result=\`echo "\$result" | sed -e 's|\r||g'\` result_err=\`echo "\$result_err" | sed -e 's|\r||g'\` foo=\`echo \$foo | sed -e 's|\r||g'\` From b128358563dbeee0ba6aed612fc8d159704c8824 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Fri, 17 May 2013 23:20:07 -0300 Subject: [PATCH 14/58] time64.h: Declare tm_zone as const under Android, but not if using C++ --- time64.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/time64.h b/time64.h index 07bb33fd849..cea1be9ed1c 100644 --- a/time64.h +++ b/time64.h @@ -28,11 +28,13 @@ struct TM64 { #endif #ifdef HAS_TM_TM_ZONE -# ifdef __GLIBC__ - const char *tm_zone; -# else - char *tm_zone; +/* If glibc is defined, use const. Otherwise, + * if we are on android, use const but not with g++ + */ +# if defined(__GLIBC__) || (defined(__ANDROID__) && !defined(__cplusplus)) + const # endif + char *tm_zone; #endif }; From db3d3b73633281c64348b1b4b540e03acf2bc33e Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 15 May 2013 08:52:18 -0300 Subject: [PATCH 15/58] MakeMaker: Groundwork for d_libname_unique 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. --- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 10 +++++++++- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm index b46bebfcd63..b752a5235d8 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm @@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue); # If we make $VERSION an our variable parse_version() breaks use vars qw($VERSION); -$VERSION = '6.66'; +$VERSION = '6.67'; $VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval] require ExtUtils::MM_Any; @@ -959,6 +959,14 @@ MAKE $(CHMOD) $(PERM_RWX) $@ MAKE + if ( $Config::Config{d_libname_unique} ) { + push @m, <<'MAKE'; +# --- d_libname_unique is true, so library names should be "unique" + $(MV) $(INST_DYNAMIC) $(INST_ARCHAUTODIR)/Perl_$(NAME_SYM).$(DLEXT) + -$(MV) $(INST_BOOT) $(INST_ARCHAUTODIR)/Perl_$(NAME_SYM).bs +MAKE + } + return join('',@m); } diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm index f271ef79282..f482d97dca8 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm @@ -18,7 +18,7 @@ our @Overridable; my @Prepend_parent; my %Recognized_Att_Keys; -our $VERSION = '6.66'; +our $VERSION = '6.67'; $VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval] # Emulate something resembling CVS $Revision$ From 3a353f1e259781102664ee760ff53986897c5482 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 15 May 2013 09:09:20 -0300 Subject: [PATCH 16/58] Teach XSLoader about d_libname_unique --- dist/XSLoader/XSLoader_pm.PL | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL index fb5707c29a4..1d07312bf3c 100644 --- a/dist/XSLoader/XSLoader_pm.PL +++ b/dist/XSLoader/XSLoader_pm.PL @@ -8,7 +8,7 @@ print OUT <<'EOT'; package XSLoader; -$VERSION = "0.16"; +$VERSION = "0.17"; #use strict; @@ -88,10 +88,17 @@ EOT my $dl_dlext = quotemeta($Config::Config{'dlext'}); -print OUT <<"EOT"; +if ( $Config::Config{d_libname_unique} ) { + print OUT <<"EOT"; + my \$module_sym = join("_", \@modparts); + my \$file = "\$modlibname/auto/\$modpname/Perl_\$module_sym.$dl_dlext"; +EOT +} +else { + print OUT <<"EOT"; my \$file = "\$modlibname/auto/\$modpname/\$modfname.$dl_dlext"; EOT - +} print OUT <<'EOT'; # print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; From e84224c2fbd68c20a7539baecba1a3fe1c23c359 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 15 May 2013 09:09:34 -0300 Subject: [PATCH 17/58] Teach DynaLoader about d_libname_unique --- ext/DynaLoader/DynaLoader_pm.PL | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 562ba2d9834..a897677f322 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -85,7 +85,7 @@ package DynaLoader; # Tim.Bunce@ig.co.uk, August 1994 BEGIN { - $VERSION = '1.18'; + $VERSION = '1.19'; } use Config; @@ -314,7 +314,14 @@ sub bootstrap { next unless -d $dir; # skip over uninteresting directories # check for common cases to avoid autoload of dl_findfile - my $try = "$dir/$modfname.$dl_dlext"; + my $try; + if ( $Config::Config{d_libname_unique} ) { + my $modsym = join("_", @modparts); + $try = "$dir/Perl_$modsym.$dl_dlext"; + } + else { + $try = "$dir/$modfname.$dl_dlext"; + } last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try); # no luck here, save dir for possible later dl_findfile search From 8c49bb70661200bd69d555e920fb6b3500f772f0 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Wed, 15 May 2013 09:09:58 -0300 Subject: [PATCH 18/58] android hints: Always define d_libname_unique --- hints/linux-androideabi.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hints/linux-androideabi.sh b/hints/linux-androideabi.sh index 8448becaf2e..2ecec5571f8 100644 --- a/hints/linux-androideabi.sh +++ b/hints/linux-androideabi.sh @@ -3,6 +3,19 @@ # Install the perl and its libraries anywhere: userelocatableinc='define' +# The Android linker has some unusual behavior: No matter what +# path is passed in to dlopen(), it'll only use the path's +# basename when trying to find a cached library. +# Unfortunately, this is quite problematic for us, since for example, +# Hash::Util and List::Util both end up creating a Util.so -- +# So if you load List::Util and then Hash::Util, the dlopen() for +# the latter will return the handle for the former. +# See the implementation for details: +# https://code.google.com/p/android-source-browsing/source/browse/linker/linker.c?repo=platform--bionic&r=9ec0f03a0d0b17bbb94ac0b9fef6add28a133c3a#1231 +# What d_libname_unique does is inform MakeMaker that, rather than +# creating Hash/Util/Util.so, it needs to make Hash/Util/Perl_Hash_Util.so +d_libname_unique='define' + # On Android the shell is /system/bin/sh: targetsh='/system/bin/sh' From 18a97d040007ed3c5252084e58d255882dd007bd Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Thu, 16 May 2013 06:34:17 -0300 Subject: [PATCH 19/58] t/op/getpid.t: Silence undef warnings if getconf doesn't exist. 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. --- t/op/getpid.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/op/getpid.t b/t/op/getpid.t index ac1f8bb7225..cc3085ae519 100644 --- a/t/op/getpid.t +++ b/t/op/getpid.t @@ -36,7 +36,7 @@ new threads( sub { ($pid2, $ppid2) = ($$, getppid()); } ) -> join(); # Newer linuxthreads from gnukfreebsd (0.11) does have POSIX thread # semantics, so include a version check # -my $thread_version = qx[getconf GNU_LIBPTHREAD_VERSION 2>&1]; +my $thread_version = qx[getconf GNU_LIBPTHREAD_VERSION 2>&1] // ''; chomp $thread_version; if ($^O =~ /^(?:gnukfreebsd|linux)$/ and $thread_version =~ /linuxthreads/ and From a7f5067e34b580a47b71edb88032262c2dc68eaf Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Fri, 17 May 2013 21:55:08 -0300 Subject: [PATCH 20/58] pod/perlport.pod: Note which functions are not available on Android --- pod/perlport.pod | 51 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/pod/perlport.pod b/pod/perlport.pod index 902092c1954..a38fdb6cb5c 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1566,6 +1566,9 @@ Access permissions are mapped onto VOS access-control list changes. (VOS) The actual permissions set depend on the value of the C in the SYSTEM environment settings. (Cygwin) +Setting the exec bit on some locations (generally /sdcard) will return true +but not actually set the bit. (Android) + =item chown Not implemented. (Win32, S, S) @@ -1583,6 +1586,8 @@ Not implemented. (Win32, VMS, S, S, VOS) May not be available if library or source was not provided when building perl. (Win32) +Not implemented. (Android) + =item dbmclose Not implemented. (VMS, S, VOS) @@ -1674,7 +1679,7 @@ Not implemented. (Win32, VMS, S) =item getnetbyname -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getpwuid @@ -1688,19 +1693,21 @@ Not implemented. (Win32, VMS, S) =item getnetbyaddr -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getprotobynumber +Not implemented. (Android) + =item getservbyport =item getpwent -Not implemented. (Win32) +Not implemented. (Android, Win32) =item getgrent -Not implemented. (Win32, VMS) +Not implemented. (Android, Win32, VMS) =item gethostbyname @@ -1713,19 +1720,23 @@ Not implemented. (Win32) =item getnetent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getprotoent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getservent Not implemented. (Win32, S) +=item seekdir + +Not implemented. (Android) + =item sethostent -Not implemented. (Win32, S, S) +Not implemented. (Android, Win32, S, S) =item setnetent @@ -1733,7 +1744,7 @@ Not implemented. (Win32, S, S) =item setprotoent -Not implemented. (Win32, S, S) +Not implemented. (Android, Win32, S, S) =item setservent @@ -1743,21 +1754,23 @@ Not implemented. (S, Win32, S) Not implemented. (Win32) +Either not implemented or a no-op. (Android) + =item endgrent -Not implemented. (S, VMS, Win32) +Not implemented. (Android, S, VMS, Win32) =item endhostent -Not implemented. (Win32) +Not implemented. (Android, Win32) =item endnetent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item endprotoent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item endservent @@ -1845,7 +1858,7 @@ Return values (especially for device and inode) may be bogus. (Win32) =item msgrcv -Not implemented. (Win32, VMS, S, S, VOS) +Not implemented. (Android, Win32, VMS, S, S, VOS) =item open @@ -1889,11 +1902,11 @@ Note that the C