public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] ldd: support .oct and .so modules
@ 2012-01-24  5:53 Yaakov (Cygwin/X)
  2012-01-24  6:04 ` Christopher Faylor
  0 siblings, 1 reply; 2+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-01-24  5:53 UTC (permalink / raw)
  To: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

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


[-- Attachment #2: utils-ldd-so-oct.patch --]
[-- Type: text/x-patch, Size: 950 bytes --]

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ldd: support .oct and .so modules
  2012-01-24  5:53 [PATCH] ldd: support .oct and .so modules Yaakov (Cygwin/X)
@ 2012-01-24  6:04 ` Christopher Faylor
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2012-01-24  6:04 UTC (permalink / raw)
  To: cygwin-patches

On Mon, Jan 23, 2012 at 11:53:23PM -0600, Yaakov (Cygwin/X) wrote:
>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.

Looks good.  Please check in.

Thanks.

cgf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-24  6:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-24  5:53 [PATCH] ldd: support .oct and .so modules Yaakov (Cygwin/X)
2012-01-24  6:04 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).