This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] ldd: support .oct and .so modules


Octave modules use the .oct extension, and several programs use .so for
modules even on Cygwin (e.g. Apache2, Mesa, OpenSSL, Ruby).  Currently,
running ldd(1) on any of these returns ENOEXEC.

The attached patch fixes ldd to treat these as DLLs and show their
runtime dependencies.


Yaakov

2012-01-??  Yaakov Selkowitz  <yselkowitz@...>

	* ldd.cc (start_process): Handle .oct and .so as DLLs.

Index: ldd.cc
===================================================================
RCS file: /cvs/src/src/winsup/utils/ldd.cc,v
retrieving revision 1.13
diff -u -p -r1.13 ldd.cc
--- ldd.cc	17 Dec 2011 23:39:47 -0000	1.13
+++ ldd.cc	24 Jan 2012 05:43:41 -0000
@@ -189,7 +189,11 @@ start_process (const wchar_t *fn, bool& 
   PROCESS_INFORMATION pi;
   si.cb = sizeof (si);
   wchar_t *cmd;
-  if (wcslen (fn) < 4 || wcscasecmp (wcschr (fn, L'\0') - 4, L".dll") != 0)
+  /* OCaml natdynlink plugins (.cmxs) cannot be handled by ldd because they
+     can only be loaded by flexdll_dlopen() */
+  if (wcslen (fn) < 4 || (wcscasecmp (wcschr (fn, L'\0') - 4, L".dll") != 0
+       && wcscasecmp (wcschr (fn, L'\0') - 4, L".oct") != 0
+       && wcscasecmp (wcschr (fn, L'\0') - 3, L".so") != 0))
     {
       cmd = wcsdup (fn);
       isdll = false;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]