Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm list-help: list-post: Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-apps AT sourceware DOT cygnus DOT com Sender: cwilson AT ece DOT gatech DOT edu Message-ID: <3921F026.333B0FC1@ece.gatech.edu> Date: Tue, 16 May 2000 21:04:38 -0400 From: Charles Wilson X-Mailer: Mozilla 4.7 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: earnie_boyd AT yahoo DOT com CC: Michael Ring , cygwin-apps AT sourceware DOT cygnus DOT com Subject: Re: Shared vs Static [WAS: Re: [general] some ideas & request for comments (LONG)] References: <20000516230710 DOT 20404 DOT qmail AT web123 DOT yahoomail DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Earnie Boyd wrote: > > This is my two cents on naming. > > First I've never really liked the fact that the library names don't reflect > whether they are static or import dll libs. So, here is my suggestion for > naming. > > If the library is an import library to a dll just name it libfoo.dll.a and if > it is a static library then name it libfoo.a. I don't like libfoo.so or > libfoo.so.a or libfoo.dll.so because the so library is the dynamic library and > not the import library. If my patches for binutils are accepted into the cygwin distro, it will no longer be necessary to USE import libs for the vast majority of dlls. So, in that sense, if import libs are provided, then they are merely as a convenience for older compilers -- except in those rare instances where the import lib does something special. So, ordinarily you'd have the following in the library search path (let's say /usr/lib): "libfoo.dll" (actually just a symlink to the dll itself, AND the link target when -Bdynamic; if libfoo.dll [or foo.dll] is not found then the next choice is libfoo.a) "libfoo.a" (the static library and only choice for a link target when -Bstatic) "libfoo.dll.a" is kicking around somewhere, but it is not ever used unless you explicitly say '-lfoo.dll' [SEE NOTE] ------------ In the wierd case, where the import lib actually does something special, you'd have: Although "libfoo.dll" is in the PATH (say /usr/bin) it is NOT in the library search path. No symlink. ld will not find it. "libfoo.a" the static library is the default link target for both -Bdynamic (since libfoo.dll & foo.dll can't be found) and -Bstatic. "libfoo.dll.a" the import library. To link against it, though, you have to hack the link command to say '-lfoo.dll' ------------ NOTE: Are you suggesting, Earnie, that binutils be further hacked to search for the following in the '-Bdynamic' case: 'libfoo.dll' 'libfoo.dll.a' (and 'foo.dll' and 'foo.dll.a' for consistency), and THEN as an absolutely last fallback, 'libfoo.a' In '-Bstatic', you'd only look for 'libfoo.a' of course. --Chuck