delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2000/05/16/21:21:48

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
list-help: <mailto:cygwin-apps-help AT sourceware DOT cygnus DOT com>
list-post: <mailto:cygwin-apps AT sourceware DOT cygnus DOT com>
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 <cwilson AT ece DOT gatech DOT edu>
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 <m DOT ring AT ndh DOT net>, 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>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019