summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2014-02-03 21:22:58 +0100
committerBrian Fraser <fraserbn@gmail.com>2014-02-03 22:46:32 +0100
commit0f8fd466a1b5d27fb08d8f768083393f9c3d3ffb (patch)
treeb20bcb5d90a1455a63c67fe45c3a9db2ce163c2c
parenta69492f5afa4bfb964605fd3f43c40392775c759 (diff)
downloadperl-0f8fd466a1b5d27fb08d8f768083393f9c3d3ffb.tar.gz
CBuilder, link: On Android, always return absolute paths to libraries
Several modules on CPAN expect being able to pass the library name returned by ->link to DynaLoader::dl_load_file and have it Just Work. However, because ->link returns relative paths, those modules ran afoul of Android's linker, which will only look in a handful of hardcoded system directories for relative libraries, plus whatever LD_LIBRARY_PATH pointed to at the start of execution. This commit makes ->link on Android always return an absolute path, which will be found by the linker.
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm14
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm2
-rw-r--r--dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm2
14 files changed, 25 insertions, 15 deletions
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
index dffec01df1..1f66c93eb8 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm
@@ -6,7 +6,7 @@ use File::Basename ();
use Perl::OSType qw/os_type/;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
$VERSION = eval $VERSION;
# We only use this once - don't waste a symbol table entry on it.
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
index 13a12984eb..c7b1a101e2 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
@@ -10,7 +10,7 @@ use IPC::Cmd qw(can_run);
use File::Temp qw(tempfile);
use vars qw($VERSION);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
# More details about C/C++ compilers:
# http://developers.sun.com/sunstudio/documentation/product/compiler.jsp
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm
index b2876944ce..2dab172862 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm
@@ -4,7 +4,7 @@ use strict;
use ExtUtils::CBuilder::Base;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Base);
sub link_executable {
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm
index 8781d1a958..d6d99c6d34 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm
@@ -4,7 +4,7 @@ use strict;
use ExtUtils::CBuilder::Base;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Base);
use File::Spec::Functions qw(catfile catdir);
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm
index 6b12f5501f..aea09bac10 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm
@@ -10,7 +10,7 @@ use ExtUtils::CBuilder::Base;
use IO::File;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Base);
=begin comment
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
index ef038ce260..7bf2573d12 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm
@@ -1,7 +1,7 @@
package ExtUtils::CBuilder::Platform::Windows::BCC;
use vars qw($VERSION);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
sub format_compiler_cmd {
my ($self, %spec) = @_;
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
index 393ccdab0e..2bdb016b19 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm
@@ -1,7 +1,7 @@
package ExtUtils::CBuilder::Platform::Windows::GCC;
use vars qw($VERSION);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
sub format_compiler_cmd {
my ($self, %spec) = @_;
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
index 490be703d9..38eb209e6a 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm
@@ -1,7 +1,7 @@
package ExtUtils::CBuilder::Platform::Windows::MSVC;
use vars qw($VERSION);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
sub arg_exec_file {
my ($self, $file) = @_;
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm
index 5c414c8877..223be29aa4 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm
@@ -5,7 +5,7 @@ use ExtUtils::CBuilder::Platform::Unix;
use File::Spec;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub need_prelink { 1 }
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm
index 461d52ee91..2e56db152b 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm
@@ -5,7 +5,7 @@ use File::Spec;
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
# The Android linker will not recognize symbols from
@@ -21,7 +21,17 @@ sub link {
];
}
- return $self->SUPER::link(%args);
+ # Several modules on CPAN rather rightfully expect being
+ # able to pass $so_file to DynaLoader::dl_load_file and
+ # have it Just Work. However, $so_file will more likely
+ # than not be a relative path, and unless the module
+ # author subclasses MakeMaker/Module::Build to modify
+ # LD_LIBRARY_PATH, which would be insane, Android's linker
+ # won't find the .so
+ # So we make this all work by returning an absolute path.
+ my($so_file, @so_tmps) = $self->SUPER::link(%args);
+ $so_file = File::Spec->rel2abs($so_file);
+ return ($so_file, @so_tmps);
}
1;
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm
index a16fa10779..9186fbb9d8 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm
@@ -5,7 +5,7 @@ use File::Spec;
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
# TODO: If a specific exe_file name is requested, if the exe created
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm
index 68d3a88fe6..e334d911d8 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm
@@ -4,7 +4,7 @@ use strict;
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub compile {
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
index 49bdb77bd4..ef2d3ee029 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm
@@ -6,7 +6,7 @@ use File::Spec;
use vars qw($VERSION @ISA);
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
sub link_executable {
my $self = shift;
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm
index 1efcbc1a62..5aec8f3adf 100644
--- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm
@@ -4,7 +4,7 @@ use strict;
use ExtUtils::CBuilder::Platform::Unix;
use vars qw($VERSION @ISA);
-$VERSION = '0.280214';
+$VERSION = '0.280215';
@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
sub need_prelink { 1 }