libtool
[Top][All Lists]
Advanced

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

Re: lt_dlopen with modules and no .la


From: Pierre Ossman
Subject: Re: lt_dlopen with modules and no .la
Date: Wed, 28 Dec 2005 14:21:38 +0100
User-agent: Mozilla Thunderbird 1.0.7-2.1.fc4.nr (X11/20051011)

Ralf Wildenhues wrote:
Hi Pierre,

* Pierre Ossman wrote on Thu, Dec 22, 2005 at 09:26:02AM CET:

On Wed, 21 Dec 2005, Pierre Ossman wrote:


When using ltdl on Windows to load plug-ins there is a problem with the name mangling system. The info.name field is only set if libltdl finds a .la file. Just the DLL won't do. The result is that symbols cannot be found becaus libltdl looks for the plain name (without prefix).


The fix should be a matter of moving the code that filters out the extension to before the branch between la and non-la files. I tried it here and it works lika a charm.


Please post the patch (with `diff -u').  Thank you.


Patch included.

--
Pierre Ossman                Telephone: +46-13-21 46 00
Cendio AB                    Web: http://www.cendio.com
--- /usr/local/share/libtool/libltdl/ltdl.c     Tue Dec 13 13:45:18 2005
+++ ltdl.c      Wed Dec 28 14:16:40 2005
@@ -3125,6 +3125,32 @@
 
   /* Check whether we are opening a libtool module (.la extension).  */
   ext = strrchr (base_name, '.');
+
+  /* extract the module name from the file name */
+  name = LT_EMALLOC (char, ext - base_name + 1);
+  if (!name)
+    {
+      ++errors;
+      goto cleanup;
+    }
+
+  /* canonicalize the module name */
+  {
+    size_t i;
+    for (i = 0; i < ext - base_name; ++i)
+      {
+        if (isalnum ((int)(base_name[i])))
+          {
+            name[i] = base_name[i];
+          }
+        else
+          {
+            name[i] = '_';
+          }
+      }
+    name[ext - base_name] = LT_EOS_CHAR;
+  }
+
   if (ext && strcmp (ext, archive_ext) == 0)
     {
       /* this seems to be a libtool module */
@@ -3141,30 +3167,6 @@
         of libtool */
       int      installed = 1;
 
-      /* extract the module name from the file name */
-      name = LT_EMALLOC (char, ext - base_name + 1);
-      if (!name)
-       {
-         ++errors;
-         goto cleanup;
-       }
-
-      /* canonicalize the module name */
-      {
-        size_t i;
-        for (i = 0; i < ext - base_name; ++i)
-         {
-           if (isalnum ((int)(base_name[i])))
-             {
-               name[i] = base_name[i];
-             }
-           else
-             {
-               name[i] = '_';
-             }
-         }
-        name[ext - base_name] = LT_EOS_CHAR;
-      }
 
       /* Now try to open the .la file.  If there is no directory name
          component, try to find it first in user_search_path and then other

reply via email to

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