Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] trim dynaloader #15022

Closed
p5pRT opened this issue Nov 1, 2015 · 8 comments
Closed

[PATCH] trim dynaloader #15022

p5pRT opened this issue Nov 1, 2015 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 1, 2015

Migrated from rt.perl.org#126533 (status was 'resolved')

Searchable as RT126533$

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2015

From @bulk88

Related to http​://www.nntp.perl.org/group/perl.perl5.porters/2015/10/msg232296.html These 2 patches remove as much as possible of bootstrap infrastructure without actually removing the bootstrap feature which hasn't been decided on yet in that thread.
 

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2015

From @bulk88

0001-remove-remains-of-dl_dld.xs.patch
From ad95bd1a08432dd574fb084dd6378967476da55c Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Fri, 30 Oct 2015 01:47:20 -0400
Subject: [PATCH 1/2] remove remains of dl_dld.xs

dl_dld.xs was removed in 5.19.4 in commit 1e5d7f5401
---
 ext/DynaLoader/DynaLoader_pm.PL | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 944ec9a..0100ae1 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -147,9 +147,6 @@ $do_expand = <<$^O-eq-VMS>>1<<|$^O-eq-VMS>>0<</$^O-eq-VMS>>;
 #@dl_librefs         = ();       # things we have loaded
 #@dl_modules         = ();       # Modules we have loaded
 
-# This is a fix to support DLD's unfortunate desire to relink -lc
-@dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs";
-
 EOT
 
 my $cfg_dl_library_path = <<'EOT';
@@ -478,7 +475,6 @@ sub dl_findfile {
             push(@names,"cyg$_.$dl_so")  unless m:/:;
 	    <</$^O-eq-cygwin>>
             push(@names,"lib$_.$dl_so")  unless m:/:;
-            push(@names,"$_.a")          if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
             push(@names, $_);
         }
 	my $dirsep = '/';
-- 
1.9.5.msysgit.1

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2015

From @bulk88

0002-remove-XSLoader-and-DynaLoader-OS-specific-code-on-N.patch
From b6251fac59d2caca220e7840b73d287695c226eb Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sat, 31 Oct 2015 06:53:54 -0400
Subject: [PATCH 2/2] remove XSLoader and DynaLoader OS specific code on NA
 OSes

@dl_resolve_using is only used on dld/freemint, and HPUX shlib loader OSes.
Dont create the array and glob on OSes where @dl_resolve_using is ignored.

sub dl_undef_symbols is only implmented on dld and freemint (freemint is
dld under a different name), otherwise it always returns empty list. Dont
call the sub on OSes where we knows it's constant retval. Saves ops+compile
time for sub bootstrap.
---
 dist/XSLoader/XSLoader_pm.PL    | 11 ++++++++++-
 ext/DynaLoader/DynaLoader_pm.PL | 13 +++++++------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL
index 414eaf2..2651596 100644
--- a/dist/XSLoader/XSLoader_pm.PL
+++ b/dist/XSLoader/XSLoader_pm.PL
@@ -7,10 +7,11 @@ eval { require DynaLoader };
 open OUT, ">XSLoader.pm" or die $!;
 print OUT <<'EOT';
 # Generated from XSLoader.pm.PL (resolved %Config::Config value)
+# This file is unique for every OS
 
 package XSLoader;
 
-$VERSION = "0.20";
+$VERSION = "0.21";
 
 #use strict;
 
@@ -144,12 +145,20 @@ print OUT <<'EOT';
     };
     push(@DynaLoader::dl_librefs,$libref);  # record loaded object
 
+EOT
+my $dlsrc = $Config{dlsrc};
+if ($dlsrc eq 'dl_freemint.xs' || $dlsrc eq 'dl_dld.xs') {
+    print OUT <<'EOT';
     my @unresolved = dl_undef_symbols();
     if (@unresolved) {
         require Carp;
         Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
     }
 
+EOT
+}
+
+print OUT <<'EOT';
     $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
         require Carp;
         Carp::croak("Can't find '$bootname' symbol in $file\n");
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 0100ae1..376b03c 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -68,7 +68,7 @@ unlink "DynaLoader.pm" if -f "DynaLoader.pm";
 open OUT, ">DynaLoader.pm" or die $!;
 print OUT <<'EOT';
 
-# Generated from DynaLoader_pm.PL
+# Generated from DynaLoader_pm.PL, this file is unique for every OS
 
 package DynaLoader;
 
@@ -85,7 +85,7 @@ package DynaLoader;
 # Tim.Bunce@ig.co.uk, August 1994
 
 BEGIN {
-    $VERSION = '1.35';
+    $VERSION = '1.36';
 }
 
 EOT
@@ -138,8 +138,9 @@ $Is_VMS    = $^O eq 'VMS';
 <</$^O-eq-VMS>>
 $do_expand = <<$^O-eq-VMS>>1<<|$^O-eq-VMS>>0<</$^O-eq-VMS>>;
 
-@dl_require_symbols = ();       # names of symbols we need
-@dl_resolve_using   = ();       # names of files to link with
+@dl_require_symbols = ();       # names of symbols we need<<$^O-eq-freemint>>
+@dl_resolve_using   = ();       # names of files to link with<</$^O-eq-freemint>><<$^O-eq-hpux>>
+@dl_resolve_using   = ();       # names of files to link with<</$^O-eq-hpux>>
 @dl_library_path    = ();       # path to look for files
 
 #XSLoader.pm may have added elements before we were required
@@ -396,13 +397,13 @@ sub bootstrap {
 	croak("Can't load '$file' for module $module: ".dl_error());
 
     push(@dl_librefs,$libref);  # record loaded object
-
+<<$^O-eq-freemint>>
     my @unresolved = dl_undef_symbols();
     if (@unresolved) {
 	require Carp;
 	Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
     }
-
+<</$^O-eq-freemint>>
     $boot_symbol_ref = dl_find_symbol($libref, $bootname) or
          croak("Can't find '$bootname' symbol in $file\n");
 
-- 
1.9.5.msysgit.1

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2015

From @tonycoz

On Sun Nov 01 09​:31​:49 2015, bulk88 wrote​:

Related to
http​://www.nntp.perl.org/group/perl.perl5.porters/2015/10/msg232296.html
These 2 patches remove as much as possible of bootstrap infrastructure
without actually removing the bootstrap feature which hasn't been
decided on yet in that thread.

+EOT
+my $dlsrc = $Config{dlsrc};
+if ($dlsrc eq 'dl_freemint.xs' || $dlsrc eq 'dl_dld.xs') {
+ print OUT <<'EOT';

why reference dl_dld.xs ?

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2015

From @bulk88

On Sun Nov 01 20​:43​:42 2015, tonyc wrote​:

On Sun Nov 01 09​:31​:49 2015, bulk88 wrote​:

Related to
http​://www.nntp.perl.org/group/perl.perl5.porters/2015/10/msg232296.html
These 2 patches remove as much as possible of bootstrap infrastructure
without actually removing the bootstrap feature which hasn't been
decided on yet in that thread.

+EOT
+my $dlsrc = $Config{dlsrc};
+if ($dlsrc eq 'dl_freemint.xs' || $dlsrc eq 'dl_dld.xs') {
+ print OUT <<'EOT';

why reference dl_dld.xs ?

Tony

XSLoader ships on cpan, unless a minimum perl version will be enforced in https://metacpan.org/source/SAPER/XSLoader-0.16/Makefile.PL you can't assume because a platform was dropped in blead, that you can immediately also drop support for it on CPAN.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2015

From @tonycoz

On Sun Nov 01 23​:36​:00 2015, bulk88 wrote​:

XSLoader ships on cpan, unless a minimum perl version will be enforced
in https://metacpan.org/source/SAPER/XSLoader-0.16/Makefile.PL you
can't assume because a platform was dropped in blead, that you can
immediately also drop support for it on CPAN.

Of course, thanks for the correction.

Applied as 73103bd and f24427c.

Tony

@p5pRT p5pRT closed this as completed Nov 2, 2015
@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2015

@tonycoz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant