develooper Front page | perl.perl5.porters | Postings from May 2004

XSLoader and dl_shared_objects

Thread Next
From:
Rafael Garcia-Suarez
Date:
May 11, 2004 02:59
Subject:
XSLoader and dl_shared_objects
Message ID:
20040511115631.10bcbe0c@localhost
Currently XSLoader (unlike DynaLoader) doesn't populate the array
@DynaLoader::dl_shared_objects with the paths of the .so files it has
loaded. This may be annoying in some cases (and notably things may break
when a module is ported from DynaLoader to XSLoader). So I suggest the
following patch to XSLoader:

Index: ext/DynaLoader/XSLoader_pm.PL
===================================================================
--- ext/DynaLoader/XSLoader_pm.PL	(revision 3506)
+++ ext/DynaLoader/XSLoader_pm.PL	(working copy)
@@ -115,6 +115,7 @@
     my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
 
     # See comment block above
+    push(@DynaLoader::dl_shared_objects, $file); # record files loaded
     return &$xs(@_);
 
   retry:
End of patch.

Another approach would be to add the $files to @XSLoader::dl_shared_objects.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About