Subject: | Cygwin: do not mess with the image base and do an ephemeral rebase on i686 |
Using a fixed image base is a bad idea on Cygwin. The Cygwin toolchains try to use auto-image-base wherever possible, don't mess with it. To greatly reduce the chance of fork problems during test, do an ephemeral rebase of the just built / installed DLL so that it doesn't conflict with other installed Cygwin libraries in i686. The auto-image-base generally can't conflict with installed libraries on x86_64, so there's no need to do that there.
Due to a bug in binutils this must not be done when building a package with cygport or no debug information will be extracted, so until the fix lands in Cygwin, allow the rebase to be skipped when the environment variable CYGWIN_PACKAGE_VERSION is defined.
Subject: | perl-ExtUtils-MakeMaker.src.patch |
--- origsrc/ExtUtils-MakeMaker-7.04/lib/ExtUtils/MM_Cygwin.pm 2014-12-02 13:44:33.000000000 +0100
+++ src/ExtUtils-MakeMaker-7.04/lib/ExtUtils/MM_Cygwin.pm 2015-05-23 22:35:24.883930100 +0200
@@ -9,7 +9,7 @@ require ExtUtils::MM_Unix;
require ExtUtils::MM_Win32;
our @ISA = qw( ExtUtils::MM_Unix );
-our $VERSION = '7.04';
+our $VERSION = '7.04_02';
=head1 NAME
@@ -129,16 +129,31 @@ But for new archdir dll's use the same r
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;
- }
- }
+ return '' unless $s;
+ return $s unless %{$self->{XS}};
+
+ # do an ephemeral rebase so the new DLL fits to the current rebase map
+ $s .= "\t/bin/find \$\(INST_ARCHLIB\)/auto -xdev -name \\*.$self->{DLEXT} | /bin/rebase -sOT -" if (( $Config{myarchname} eq 'i686-cygwin' ) and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
+ $s;
+}
+
+=item install
+
+Rebase dll's with the global rebase database after installation.
+
+=cut
+
+sub install {
+ my($self, %attribs) = @_;
+ my $s = ExtUtils::MM_Unix::install($self, %attribs);
+ return '' unless $s;
+ return $s unless %{$self->{XS}};
+
+ my $INSTALLDIRS = $self->{INSTALLDIRS};
+ my $INSTALLLIB = $self->{"INSTALL". ($INSTALLDIRS eq 'perl' ? 'ARCHLIB' : uc($INSTALLDIRS)."ARCH")};
+ my $dop = "\$\(DESTDIR\)$INSTALLLIB/auto/";
+ my $dll = "$dop/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}";
+ $s =~ s|^(pure_install :: pure_\$\(INSTALLDIRS\)_install\n\t)\$\(NOECHO\) \$\(NOOP\)\n|$1\$(CHMOD) \$(PERM_RWX) $dll\n\t/bin/find $dop -xdev -name \\*.$self->{DLEXT} /bin/rebase -sOT -\n|m if (( $Config{myarchname} eq 'i686-cygwin') and not ( exists $ENV{CYGPORT_PACKAGE_VERSION} ));
$s;
}