texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Wed, 20 Nov 2024 16:29:00 -0500 (EST)

branch: master
commit 9a7ac81a9e51abfdbe0974b57e261f2136490782
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Nov 20 21:19:59 2024 +0000

    * tp/Texinfo/XSLoader.pm (init): Use additional libraries
    argument to call load_libtool_library.  These means we locate
    and load these libraries directly rather than relying on the
    dynamic linker to locate the libraries as a dependency of
    other libraries.
---
 ChangeLog              |  8 ++++++++
 tp/Texinfo/XSLoader.pm | 22 +++++++++++++++-------
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 488ca67ba0..453495ba65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-20  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XSLoader.pm (init): Use additional libraries
+       argument to call load_libtool_library.  These means we locate
+       and load these libraries directly rather than relying on the
+       dynamic linker to locate the libraries as a dependency of
+       other libraries.
+
 2024-11-20  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XSLoader.pm (init, load_libtool_library):
diff --git a/tp/Texinfo/XSLoader.pm b/tp/Texinfo/XSLoader.pm
index 3b821a88b5..ce7b8d0175 100644
--- a/tp/Texinfo/XSLoader.pm
+++ b/tp/Texinfo/XSLoader.pm
@@ -157,6 +157,8 @@ sub load_libtool_library {
   return $libref;
 }
 
+our $loaded_additional_libraries = {};
+
 # Load module $MODULE, either from XS implementation in
 # Libtool file $MODULE_NAME and Perl file $PERL_EXTRA_FILE,
 # or non-XS implementation $FALLBACK_MODULE.
@@ -199,13 +201,19 @@ sub init {
     goto FALLBACK;
   }
 
-  # if ($additional_libraries and scalar(@$additional_libraries)) {
-  #   my @found_additional_libraries
-  #     = DynaLoader::dl_findfile(@$additional_libraries);
-  #   _debug("additional libraries: ".join('|', @$additional_libraries));
-  #   _debug("found additional: ".join('|', @found_additional_libraries));
-  #   push @DynaLoader::dl_resolve_using, @found_additional_libraries;
-  # }
+  if ($additional_libraries) {
+    for my $additional_library (@{$additional_libraries}) {
+      $additional_library =~ s/^-l/lib/;
+      if (!$loaded_additional_libraries->{$additional_library}) {
+        my $ref = load_libtool_library($additional_library);
+        if (!$ref) {
+          goto FALLBACK;
+        } else {
+          $loaded_additional_libraries->{$additional_library} = $ref;
+        }
+      }
+    }
+  }
 
   my $libref = load_libtool_library($module_name);
   if (!$libref) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]