Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 104663
Status: resolved
Worked: 40 min
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: BINGOS [...] cpan.org
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 7.04
Fixed in:
  • 7.11_01
  • 7.11_02
  • 7.11_03
  • 7.11_04
  • 7.11_05
  • 7.11_06
  • 7.12



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; }
Thanks for the report. I see your patch is against 7.04. Can you confirm it is still needed, and still works, on the latest (7.05_20 - see the github repo)? Also, what is your test case that reliably demonstrates this is a problem that needs solving?
On Sun May 24 11:46:04 2015, ETJ wrote: Show quoted text
> Thanks for the report. I see your patch is against 7.04. Can you > confirm it is still needed, and still works, on the latest (7.05_20 - > see the github repo)?
I'll do that later, out of time at the moment. Show quoted text
> Also, what is your test case that reliably demonstrates this is a > problem that needs solving?
Tons of fork errors when building and testing any non-trivial module producing a DLL on 32bit Cygwin?
On Sun May 24 11:46:04 2015, ETJ wrote: Show quoted text
> Thanks for the report. I see your patch is against 7.04. Can you > confirm it is still needed, and still works, on the latest (7.05_20 - > see the github repo)?
I've updated the patch for 7.05_22 by just changing the version string and moving the second hunk one line down. It passes all tests on current Cygwin (both architectures) and yes, it is needed on i686 / 32bit to prevent massive fork errors on anything using a DLL that doesn't get installed as a normal Cygwin package (in which case autorebase would really do the rebasing). Bootstrapping the 190 Perl distributions for the upcoming 5.22 switch on Cygwin would've been pretty much ipossible without this patch.
Subject: perl-ExtUtils-MakeMaker.src.patch
--- origsrc/ExtUtils-MakeMaker-7.05_22/lib/ExtUtils/MM_Cygwin.pm 2015-06-14 15:07:42.000000000 +0200 +++ src/ExtUtils-MakeMaker-7.05_22/lib/ExtUtils/MM_Cygwin.pm 2015-06-22 14:37:03.957966200 +0200 @@ -9,7 +9,7 @@ require ExtUtils::MM_Unix; require ExtUtils::MM_Win32; our @ISA = qw( ExtUtils::MM_Unix ); -our $VERSION = '7.05_22'; +our $VERSION = '7.05_23'; $VERSION = eval $VERSION;
Show quoted text
> I've updated the patch for 7.05_22 by just changing the version string > and moving the second hunk one line down.
Sorry, the patch got truncated, attaching it again.
Subject: perl-ExtUtils-MakeMaker.src.patch
--- origsrc/ExtUtils-MakeMaker-7.05_22/lib/ExtUtils/MM_Cygwin.pm 2015-06-14 15:07:42.000000000 +0200 +++ src/ExtUtils-MakeMaker-7.05_22/lib/ExtUtils/MM_Cygwin.pm 2015-06-22 15:02:42.444915900 +0200 @@ -9,7 +9,7 @@ require ExtUtils::MM_Unix; require ExtUtils::MM_Win32; our @ISA = qw( ExtUtils::MM_Unix ); -our $VERSION = '7.05_22'; +our $VERSION = '7.05_23'; $VERSION = eval $VERSION; @@ -130,16 +130,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; }
On Mon Jun 22 09:06:23 2015, https://me.yahoo.com/howdidwegetherereally#f714d wrote: Show quoted text
> > I've updated the patch for 7.05_22 by just changing the version string > > and moving the second hunk one line down.
> > Sorry, the patch got truncated, attaching it again.
Thanks. Patched in repository.
On Wed Jun 24 15:16:01 2015, BINGOS wrote: Show quoted text
> Thanks. Patched in repository.
Thanks and also for correting the missing pipe.
Closing ticket as 7.12 is out. Many thanks.