libtool-patches
[Top][All Lists]
Advanced

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

Re: Bad libdir entry in .la files on MSYS/MinGW


From: Peter Rosin
Subject: Re: Bad libdir entry in .la files on MSYS/MinGW
Date: Wed, 04 Feb 2009 22:48:26 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Den 2009-02-04 22:26, skrev Ralf Wildenhues:
Hi Peter,

* Peter Rosin wrote on Wed, Feb 04, 2009 at 11:11:04AM CET:
While playing with func_to_host_path etc by Chuck, I noticed that the
libdir entry of installed .la files on MSYS/MinGW contains a path
in MSYS format. However, libltdl uses this path to locate the actual
module and that will always fail, since MinGW knows nothing about
MSYS paths. I think MSYS/MinGW usually gets by without this working
since libltdl also checks if the .la file *and* the module itself
have been moved, and thus often finds the module relative to where
it happened to find the .la file.

Attached testcase succeeds on Cygwin and fails on MSYS/MinGW.

Is this a sane test? Ok to push?

[...]
+# Try finding the module via the libdir entry in a misplaced .la file.
+
+mv $libdir/a.la $bindir/a.la

Can you explain why this is necessary?  I don't quite understand it,
given the text above.

If you look in libltdl/ltdl.c:find_module(), you have:

  if (dlname)
    {
      /* try to open the installed module */
      if (installed && libdir)
        {
          if (tryall_dlopen_module (handle, (const char *) 0,
                                    libdir, dlname, advise) == 0)
            return 0;
        }

This tryall_dlopen_module will never succeed on MSYS/MinGW since
'libdir' is an MSYS path, on other hosts it normally succeeds. I
thought this might be a significant difference, and the simplest
way I could think of to tickle it was to separate the .la file from
the .dll file (or .so, whatever). The reason you need to separate
them is that otherwise find_module succeeds later in:

      /* maybe it was moved to another directory */
      {
          if (dir && (tryall_dlopen_module (handle, (const char *) 0,
                                            dir, dlname, advise) == 0))
            return 0;
      }

Where 'dir' is the dir of the .la file (at least I think so).

Hope that clarifies it...

Cheers,
Peter




reply via email to

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