summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2010-09-14 17:54:15 +0200
committerJesse Vincent <jesse@bestpractical.com>2011-01-04 16:42:17 +0800
commit172830635ea7813c85e51e4ae2b4bed56ddbab83 (patch)
treeee41433f7beb8d8d3fbfaa32a1a8ae2bfea7ee8c
parent7fbcd92047c47e4c2ab139db2ac997a3227b8312 (diff)
downloadperl-172830635ea7813c85e51e4ae2b4bed56ddbab83.tar.gz
Improve cygwin rebase behaviour
If a dll is updated on cygwin reuse the old imagebase address. This solves most rebase errors, esp when updating on core dll's. See http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README
-rw-r--r--cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
index d1de9d23f1..19aab840ef 100644
--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm
@@ -116,6 +116,29 @@ sub maybe_command {
return $self->SUPER::maybe_command($file);
}
+=item dynamic_lib
+
+Use the default to produce the *.dll's.
+But for new archdir dll's use the same rebase address if the old exists.
+
+=cut
+
+sub dynamic_lib {
+ my($self, %attribs) = @_;
+ my $s = ExtUtils::MM_Unix::dynamic_lib($self, %attribs);
+ my $ori = "$self->{INSTALLARCHLIB}/auto/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}";
+ if (-e $ori) {
+ my $imagebase = `/bin/objdump -p $ori | /bin/grep ImageBase | /bin/cut -c12-`;
+ chomp $imagebase;
+ if ($imagebase gt "40000000") {
+ my $LDDLFLAGS = $self->{LDDLFLAGS};
+ $LDDLFLAGS =~ s/-Wl,--enable-auto-image-base/-Wl,--image-base=0x$imagebase/;
+ $s =~ s/ \$\(LDDLFLAGS\) / $LDDLFLAGS /m;
+ }
+ }
+ $s;
+}
+
=back
=cut