Tue Jan 27 04:08:27 2015: Request 101770 was acted upon.
Transaction: Ticket created by MJAIX
       Queue: PAR-Packer
     Subject: Fix for PAR-Packer 1.024 with a nonstandard libperl.so name
   Broken in: 1.024
    Severity: Normal
       Owner: RSCHUPP
  Requestors: mj...@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101770 >


Having Perl built with a shared library named differently, PAR ceased to work 
properly.
For some time, my resulting executable had not been static regarding libperl, 
and with PAR-Packer 1.024 (no test done with 1.023), even compilation did not 
work anymore.
The root cause is that in myldr/Makefile.PL, in one place /\s+-lperl\s+/ gets 
blindly stripped off from ldflags, although some lines apart the libperl name 
is obeyed.

Detected in 1.024 (present in earlier releases).
Fixed in 1.025 almost at light speed :-); this entry is for record completeness.
Successfully tested 1.025 on Linux and Solaris 10.

[src/PAR-Packer-1.024/myldr] -> diff -c Makefile.PL*
*** Makefile.PL               Fri Nov  7 09:23:43 2014
--- Makefile.PL.mja_dynperlfix  Fri Jan 23 11:12:46 2015
***************
*** 142,150 ****
  my $ldflags = "$lddebug$pldflags $perl58lib";
  my $static_ldflags = $ldflags;
  
- $static_ldflags =~ s/\s+-lperl\s+/ /g;
- $boot_ldflags .= $static_ldflags;
- 
  my $libperl;
  
  if ($dynperl and $^O eq 'os2') {
--- 142,147 ----
***************
*** 169,174 ****
--- 166,182 ----
      undef $dynperl if !-e $libperl;
  }
  
+ my $perllibshortname = 'perl';
+ if ($dynperl) {
+     $perllibshortname = basename($libperl);
+     my $so = $Config{so} || 'so';
+     $perllibshortname =~ s/^lib//;
+     $perllibshortname =~ s/\Q.$so\E$//;
+ }
+ $static_ldflags =~ s/\s+-l$perllibshortname\s+/ /g;
+ $boot_ldflags .= $static_ldflags;
+ 
+ 
  # In the $dynperl case, we've already found the $libperl DSO.
  # The only problem is: when the linker links $par_exe against $libperl
  # we don't know what name is used to refer to $libperl in the executable

---------------------------- end of context diff ---------------------------

Reply via email to