public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: DLL naming conventions
@ 2000-09-04  5:31 Bernard Dautrevaux
  2000-09-04  5:44 ` Robert Collins
  0 siblings, 1 reply; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-09-04  5:31 UTC (permalink / raw)
  To: 'Charles Wilson', cygwin; +Cc: gvv

> -----Original Message-----
> From: Charles Wilson [ mailto:cwilson@ece.gatech.edu ]
> Sent: Sunday, September 03, 2000 8:00 AM
> To: cygwin@sources.redhat.com
> Cc: gvv@techie.com
> Subject: Re: DLL naming conventions
> 
> 
	<skipped>

> 
> Won't fix the problem for exe's that aren't part of the official
> install, but you can work around that by requiring that 
> /bin,/usr/bin be
> in the front of the path (prior to 'outside' dirs). Even this, though,
> will not fix the problem for 'modeless' users (Michael's 'user 2') --
> because modeless users don't want /usr/bin in the front.
> 
> However, no modeless users (except for Paul) have complained.  Perhaps
> Paul should become modal. :-)

The problem iw that when you say "modal" you are really saying that we
should have several sandboxes and that a programm from sandbox "cygwin"
could not play with (i.e. call) a program with sandbox "pw32" or "mingw32";
that was exactly what render the Win32 Posix subsystem so inattractive: it
can't mix with win32.

Here the situation would only be slightly better: it may work by chance and
suddenly fall apart in the wrong place (i.e. I added something to mingw32
sandbox, and then a program from the cygwin sandbox no more works, assuming
I need to call some mingw32 program from cygwin bash...)

I *know* that having cygpng.dll instead of libpng.dll is a bit of a burden
for cygwin maintainers, but defining the convention and using it to all new
ports should prevent the problem to suddenly arise when there will be more
conflict than the apparently isolated zlib problem.

The fact that only one complain was received does not mean that there is no
problem and that we should not try to avoid the problem to be come worse.
Then progressively one could start rename all libfoo.dll's as cyfoo.dll,
still providing libfoo.dll as an interim measure to let maintainers update
their ports (which should only require a recompile provided libfoo.dll.a now
reflects cyfoo.dll).

Otherwise I'm afraid that one day the list suddenly gets filled of complains
of people saying: "I've installed foo.x.y on cygwin-1.1.4 and gets a
segfault in libbar.dll when running foo" with answers like "Don't
understand; I also use foo.x.y on cygwin-1.1.4 and do not have any problem;
do you also install xchess?" and all the expected messages to finally
understand that the native mingw32 port of gnugo also installs a libbar.dll
that is incompatible with the one needed by foo.x.y and provided by cygwin
or some other package foo depends on.

> 
> > I love being as
> > close to UNIX as possible but if it is going to cause problems then
> > it makes sense not to do things that way.
> 
> Yep -- so libtool and dll versioning issues should be 
> addressed.  But it
> appears that the 'modal' PATH requirement is the least 
> intrusive method
> of fixing the platform-specific dll confusion (e.g. native vs. cygwin
> vs. UWin vs. PW dll's, all with the same name).
> 

I don't think so, as we must rely on the PATH and thus are NOT allowed to
have two different sandboxes in one PATH (not even perhaps the standard
WIN32 directories) as we may have conflicts. Right conflicts with WIN32
native DLLs is quite improbable but that's just because this fancy "lib"
prefix for cygwin dlls :-)

I think what was proposed here was just refining a bit this convention,
saying that "lib" should be avoided (by *everybody* IMNSHO) but replaced by
a short prefix that should try to be as unambiguous as possible (and if
possible 3-char-long to avoid breaking some habits and poorly written sed
scripts) like for example "cyg" for cygwin, "mgw" for mingw32, "pow" for
Paul's Powix-On-Windows layer and so on.

This would not be perfect and clashes will still be possible but at least
they will be a lot less likely.

As for the versioning I favor without any doubt versioning the DLLs for
incompatible ABI/API changes while the (needed) import library is
non-versioned. But I think the scheme is almost agreed upon, at least for
the future when ABI or API-incompatible versions of not-yet-versioned DLLs
will appear.

Regards,

		Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* Re: DLL naming conventions
@ 2000-09-05  8:56 Earnie Boyd
  0 siblings, 0 replies; 81+ messages in thread
From: Earnie Boyd @ 2000-09-05  8:56 UTC (permalink / raw)
  To: Egor Duda

--- Egor Duda <deo@logos-m.ru> wrote:
> Hi!
> 
> Tuesday, 05 September, 2000 Earnie Boyd earnie_boyd@yahoo.com wrote:
> 
> EB> --- Chris Faylor <cgf@cygnus.com> wrote:
> >> 
> >> Of course, if we ever write our "registry as a file system" module for
> >> cygwin, you could have a tar file which extracted executables to /bin
> >> and registry information to /registry/LocalMachine/Software/...
> >> 
> 
> EB> Hey, I like this.  So then, `ls /registry/LocalMachine/Software' should
> then
> EB> list the registry.  Cool, just cool.
> 
> not  so  cool  as  you  can think. i've implemented such "plugin" to
> cygwin  somewhere  around 1998, and ls /registry/LocalMachine/Software
> worked ok. and
> 
> cat "/registry/CurrentUser/Software/Cygnus Solutions/Cygwin/mounts
> v2/cygdrive prefix"
> 
> worked  ok  too. but when i dug into this, i couldn't find good mapping
> from  registry  semantics  to  unix-stype  file  system semantics. for
> example,  registry values can be of several different types -- string,
> multistring,  binary,  dword, etc. what should this be looking like in
> fs tree?
> 

Uhm, the data values would be ok to cat and tar but not ok to ls.  The registry
keys would be the fs tree and the registry data would be the what would be
read.

> putting  /registry/.../ into tar.gz should work, though, if only we'll
> use string type values only.
> 

It should even be ok with the other types of data as long is you ensured the
data was processed in binary mode.

Ok, sure I'm probably oversimplifying it.

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* Re: DLL naming conventions
@ 2000-09-05  5:37 Earnie Boyd
  2000-09-05  7:32 ` Egor Duda
  0 siblings, 1 reply; 81+ messages in thread
From: Earnie Boyd @ 2000-09-05  5:37 UTC (permalink / raw)
  To: cygwin

--- Chris Faylor <cgf@cygnus.com> wrote:
> 
> Of course, if we ever write our "registry as a file system" module for
> cygwin, you could have a tar file which extracted executables to /bin
> and registry information to /registry/LocalMachine/Software/...
> 

Hey, I like this.  So then, `ls /registry/LocalMachine/Software' should then
list the registry.  Cool, just cool.

=====
--- < http://earniesystems.safeshopper.com > ---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-09-04  8:38 Bernard Dautrevaux
  2000-09-04 13:59 ` Robert Collins
  0 siblings, 1 reply; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-09-04  8:38 UTC (permalink / raw)
  To: 'Charles S. Wilson', Robert Collins, cygwin

> -----Original Message-----
> From: Charles S. Wilson [ mailto:cwilson@ece.gatech.edu ]
> Sent: Monday, September 04, 2000 5:09 PM
> To: Robert Collins; cygwin@sources.redhat.com
> Subject: Re: DLL naming conventions
> 
> 
	....

> 
> Here's the search order for DLL's when an AppPath key is set for the
> executable in the registry:
> 
> 1.The directories listed in the App Path registry key 
> 
> 2.The directory where the executable module for the current process is
> located. 
> 
> 3.The current directory. 
> 
> 4.The Windows system directory. The GetSystemDirectory function
> retrieves the path of this directory. 
> 
> 5.The Windows directory. The GetWindowsDirectory function 
> retrieves the
> path of this directory. 
> 
> 6.The directories listed in the PATH environment variable.
> 
> 
> See http://codeguru.earthweb.com/dll/AppPath.shtml
> 
> So, if all .exe's are installed using 'install.exe', and 
> install.exe is
> made smart enough to create an AppPath key for each one -- the problem
> is solved!
> 
> (sotto voce: ermmm...three minor problems:
> 
> 1. The AppPath entry must be in windows-format:
> C:\cygwin\bin;C:\cygwin\usr\local\bin  NOT /bin:/usr/local/bin.  What
> happens when you reinstall cygwin to a different location -- say
> D:\cygwin -- and change the mount points?
> 
> 2. The AppPath entry is keyed by the program name:
> 
> HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\foo.exe
>   default value is string   = "C:\cygwin\usr\local\bin\foo.exe"
>   string value named "Path" = "C:\cygwin\bin;C:\cygwin\usr\local\bin"
> 
> What if you have two foo.exe's -- one cygwin, and one mingw ?

Or cygwin find/native find ? Gonna crash the find feature of Explorer?

> 
> 3. It doesn't work if there is already a dll with the same 
> name, loaded
> into memory (for Win95, Win98, and WinNT; the following 
> analysis doesn't
> apply to Win98SE or W2K)
> 
> e.g. 
>   c:\cygwin\usr\local\bin\app1.exe
>     (app1.exe has AppPath key so that c:\cygwin\usr\bin is searched
> first)
>   c:\cygwin\usr\bin\my-dll.dll
> 
>   c:\mingw\usr\local\bin\app2.exe
>     (app2.exe has AppPath key so that c:\mingw\usr\bin is searched
> first)
>   c:\mingw\usr\bin\my-dll.dll
> 
> Run app1.exe -- fine, c:\cygwin\usr\bin\my-dll.dll gets loaded.
> Run app2.exe -- *will not load* c:\mingw\usr\bin\my-dll.dll 
> into memory.
> 
> This analysis extrapolated from description in:
> http://codeguru.earthweb.com/mfc/comments/6493.shtml
> 
> Maybe the problem isn't solved by AppPath, after all.
> 

This seems to say that DLLs are searched FIRST in memory, then on the disk
(at least on NT and 95/98)... That was what I seems to understand while
reading MSDN Library where they says that side-by-side libraries avoid this
preference given to already loaded libraries.

If this proves true, then the only solution would be to change the name of
the DLLs ;-(

Note that the in-memory problem is particularly important giving the fact
that a lot of windoze apps (cygwin or not) are usually long-lived especially
if they have a GUI. Thus if one starts a mingw GUI app that uses libpng.dll
(quite logical) then NO cygwin app using libpng will be able to run as it
will always try to use the mingw-libpng.dll in memory.

Does that mean that most ported unix apps were not interactive apps but
short-lived ones or that people are so sued to PCs crashing when trying to
do several things at once that they do not complain :-)

Cheers,

		Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-09-04  8:18 Bernard Dautrevaux
  0 siblings, 0 replies; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-09-04  8:18 UTC (permalink / raw)
  To: 'Charles S. Wilson', Robert Collins; +Cc: cygwin

> -----Original Message-----
> From: Charles S. Wilson [ mailto:cwilson@ece.gatech.edu ]
> Sent: Monday, September 04, 2000 4:23 PM
> To: Robert Collins
> Cc: cygwin@sources.redhat.com
> Subject: Re: DLL naming conventions
> 
> 
> Robert Collins wrote:
> > 
> > but this also means that mingw32 program won't use the 
> cygwin compiled
> > libpng if it is there? is that acceptable?
> 
> mingw programs can't use cygwin libraries. Period. This is due to
> library dependencies.
> 
> cygwin-libpng.dll depends on cygwin1.dll, which implements many of the
> runtime functions, such as printf(), startup code, etc.  
> 
> A mingw program (or mingw-libpng.dll, for that matter), depends on
> crt.dll (or msvcrt.dll, depending on which flavor of mingw you're
> using).  crt.dll (or msvcrt.dll) implement printf(), startup 
> code, etc.
> 
> If you were to link a mingw-compiled .o with a 
> cygwin-libpng.dll, using
> the mingw linker -- which printf() would get used? Which 
> startup code? 
> Well, actually the link would fail -- due to 'duplicate symbol'
> problems.
> 
> And all this happens *without* mysterious mingw-libpng.dll /
> cygwin-libpng.dll DLL hell.

Sure; it will also happen if linking a mingw-compiled foo.o with a
cygwin-compiled bar.o and this whatever the linker is (mingw or cygwin).

> 
> > -> if we are looking to keep the sandbox's separate then 
> yes.. but why care
> > about running a (say) mingw32 program from cygwin bash...
> 
> Okay, now this is a valid issue.  But, you are much too 
> unspecific.  You
> can still call a generic mingw32 program from cygwin bash.  The
> assumption is, that while in bash, the PATH is set so that cygwin's
> /usr/bin,/bin is in the front.  But that doesn't mean that some mingw
> directory cannot be toward the back of the path.  Finally, recall that
> dll's will get loaded preferentially from the same directory that the
> executable is in.
> 
> So, the *only* way you get in trouble is if ALL of the following are
> true:  You run bash.  cygwin's /usr/bin,/bin is in the front of the
> PATH.  You call 'mingw-program1', which depends on the mingw 
> version of
> my-dll.dll.  mingw-program1 is in, say, c:\mingw\usr\local\bin. 
> my-dll.dll is in c:\mingw\usr\bin -- e.g. a different directory that
> mingw-program1.  There is a cygwin-compiled version of my-dll.dll, in
> cygwin's /usr/bin. 
> 
> Pretty damn unlikely, IMO. 

Not so unlikely, if using libraries from contributed packages, that get
installed if following the standards, under /usr/local/package-x.y.z. I may
get one compiled for cygwin in C:\cygwin\usr\local\package-x.y.z and the
mingw32 one in c:\mingw\usr\local\package-x.y.z.

Now HOW could I set up my path?

I agree I can stash ALL cygwin stuff in C:\cygwin\usr\bin and ALL mingw32
stuff in C:\mingw\bin, but that seems even more hacky as having cygfoo.dll
and mgwfoo.dll located where I expect them :-)

> 
> > -> if we are looking to let things cross the sandbox we 
> should decide _what_
> > things, (ie bin/pipes, bin/pipes/libs, binaries only..) we 
> are able to
> > support and then make it as flexable as possible.
> 
> libraries cannot. pipes probably can (given the textmode/binmode
> issues...). Of course you can call programs from native- or
> other-unix-on-win platforms; as long as there is no confusion about
> dll's.
> 
> All we're discussing is how to avoid dll hell between these platforms.

100% agreed

> 
> > 
> > I think we need to make that decide first, and then the 
> rest falls into
> > place....
> > 
> > if we want full cross over from the sandboxes then the 
> answer should permit
> > only porting layer/method to use another libraries. So a 
> port layer/method
> > specific library naming convention is not acceptable. 
> 
> Can't use other-compiled versions of libraries anyway (okay, 
> *maybe* you
> can mix mingw and msvc, but that's not at issue here. We're talking
> about cygwin.)

In fact, under some conditions (mainly: no reference to msvcrt.dll nor
crtlib.dll) we should be able to use any native win32 DLL with either mingw
or cygwin or any other posix-on-windoze layer. In fact it is even almost a
requirement or we get in some kind of a closed sandbox like was Microsoft
POSIX subsystem.

> 
> > likewise if we want
> > sandboxes then porting layer/method specific library file 
> names becomes
> > mandatory.
> 
> Not necessarily, if the PATH settings (or insuring that all dll's and
> exe's go into the same directory) are sufficient to prevent 
> problems.  

Problem is that is a nightmare to manage a "stash everything in one dir"
installation method.

> I
> don't think so, personally.  As distasteful and painful as 
> renaming all
> the dll's is, it *may*, repeat *may*, be the best option.  

100% agreed; the fact that I don't *know* a better approach does not mean
there isn't one!

> I believe
> Chris is proactively doing some research; it is possible that 
> we can do
> something else, and avoid the 'cyg' prefix -- like using the 'AppPath'
> registry or something.

AppPath may be a solution, but with the problem that this puts the burden on
the package installer and expect *all* other package to be as clever as
mingw ?-) and I'm not sure of how to say when installing a package that DLLs
should be loaded ONLY from subdirectories of C:\cygwin or from standard
places even if the path contains directories where we can find a "matching"
DLL.

This may be a bit complicated, error prone and difficult to maintain (never
seen a dumb installer crashing the registry?)

> 
> It's just that there is an ingrained desire to stay as unix-like as
> possible -- and that means, libraries start with 'lib', not 'cyg'. 

And they end in .so.x.y, not .dll :-)

We had to change th esuffix, so changing the prefix will not break anything
more (i.e. almost nothing IIRC).

> If
> AppPath can fix the problem, then I'd prefer that cygwin's install.exe
> set the appropriate registry entry whenever installing an executable. 

This would mean that install.exe should analyze DLL dependencies when
installing an exe to list all the cygwin directories where to find DLLs;
however this will now add a dependency on the order of installation between
packages providing DLLs and the ones providing EXEs because this would not
be possible if the installed EXE reference a not-yet-installed DLL :-)

> This won't catch *everything*, but dagnabbit, I'm tired of packages
> installing themselves with cp (which break on cygwin thanks 
> to the .exe
> suffix).  They oughta use install.

Sure, but I'm not sure install.exe will be able to solve the problem without
being provided with a lot of other info. (BTW does setup.exe install things
by calling install.exe or just by untarring them at the proper place?)

Another problem is that people may use cygwin as their hosting UNIX-on-WIN
environment and use install.exe to install their application code that may
be mingw32 or natively compiled! here the install.exe magic (which is
definitely not expected by UNIX users) will broke everything :-)

The problem that install.exe is more a programming environment tool than an
end-user tool that is to be executed when one simply wants to use a package.
Even on UNIX, one rarely if ever execute "install" when installing a binary
distribution fo a package.

> 
> > 
> > Personally I think that a mingw32 libpng should be useable 
> by cygwin gcc AND
> > cygwin distributed binaries, given that they are the same 
> version... (and
> > that should be part of the naming convention).
> 
> Just cannot be done. Sorry.
> 

True!

Cheers

		Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-09-04  6:59 Bernard Dautrevaux
  0 siblings, 0 replies; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-09-04  6:59 UTC (permalink / raw)
  To: 'Robert Collins', cygwin

> -----Original Message-----
> From: Robert Collins [ mailto:robert.collins@itdomain.com.au ]
> Sent: Monday, September 04, 2000 2:44 PM
> To: cygwin@sources.redhat.com
> Subject: Re: DLL naming conventions
> 
> 
> ...
> 
> > > However, no modeless users (except for Paul) have 
> complained.  Perhaps
> > > Paul should become modal. :-)
> >
> > The problem iw that when you say "modal" you are really 
> saying that we
> > should have several sandboxes and that a programm from 
> sandbox "cygwin"
> > could not play with (i.e. call) a program with sandbox "pw32" or
> "mingw32";
> > that was exactly what render the Win32 Posix subsystem so 
> inattractive: it
> > can't mix with win32.
> >
> > Here the situation would only be slightly better: it may 
> work by chance
> and
> > suddenly fall apart in the wrong place (i.e. I added 
> something to mingw32
> > sandbox, and then a program from the cygwin sandbox no more works,
> assuming
> > I need to call some mingw32 program from cygwin bash...)
> >
> > I *know* that having cygpng.dll instead of libpng.dll is a 
> bit of a burden
> > for cygwin maintainers, but defining the convention and 
> using it to all
> new
> > ports should prevent the problem to suddenly arise when 
> there will be more
> > conflict than the apparently isolated zlib problem.
> 
> but this also means that mingw32 program won't use the cygwin compiled
> libpng if it is there? is that acceptable?

Not only acceptable but usually needed, as the mingw32 program will use (for
example) MSVCRT version of free() to free some memory allocated by CYGWIN
version of malloc() called from cygwin-compiled libpng; all this will have
one more than probable result: SEGFAULT ;-(

> -> if we are looking to keep the sandbox's separate then 
> yes.. but why care
> about running a (say) mingw32 program from cygwin bash...

Because perhaps some program that is not GPLed nor GPLable was ported from
UNIX to NT and thus cannot be using cygwin...

BTW this mean there must be a way to ensure that a program not compiled for
cygwin will not by error link against cygwin1.dll through some other DLL or
that program will become GPLed without its author being aware of it!...
Hopefully the program will crash without doing anything meaningful I think
so that's not too bad :-)

> -> if we are looking to let things cross the sandbox we 
> should decide _what_
> things, (ie bin/pipes, bin/pipes/libs, binaries only..) we are able to
> support and then make it as flexable as possible.

Anything tha'ts natively supported on WIN32 for inter-process-communication
should be usable and is for now I think, at least starting programs,
reading/writing files, sockets and probably pipes. 

Libs on the opposite are usually NOT mixable between environments. (note
that it's not even possible to link a program using MSVCRT.DLL with a
library built against CRTLIB.DLL, even if they are both almost
source-compatible, and not even possible to mix various versions of
MSVCRT.DLL); so we should not only forget about mixing
native/cygwin/mingw32/PW libraries but I would even favor forbidding it.

The only thing that is needed is that low-level native WIN32 DLLs should be
accessible from all "sandboxes" but the reverse is usually not possible
because the C runtime environments will be incompatible. We have exactly the
same problem on Linux: any program can access the kernel, but a
libc5-compatible library cannot call code from a libc6-compatible one and
vice-versa.

> 
> I think we need to make that decide first, and then the rest 
> falls into
> place....
> 

Sure :-)

> if we want full cross over from the sandboxes then the answer 
> should permit
> only porting layer/method to use another libraries. So a port 
> layer/method
> specific library naming convention is not acceptable. 

I presume you say: suppressing any barrier between sandboxes (i.e. on Linux
should be between libc5 and libc6); I do not think this is even possible.

> likewise if we want
> sandboxes then porting layer/method specific library file 
> names becomes
> mandatory.

This would be what we get now under Linux: programs compiled under libc5 and
libc6 are able to work together freely, but not to share code.

> 
> Personally I think that a mingw32 libpng should be useable by 
> cygwin gcc AND
> cygwin distributed binaries, given that they are the same 
> version... (and
> that should be part of the naming convention).

This would only work if libpng makes NO calls to the C Runtime Library (that
is do NOT depend on MSVCRT.DLL or CRTDLL.DLL); otherwise the program will
just crash.

Cheers,

		Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-09-04  6:11 Bernard Dautrevaux
  2000-09-05 14:28 ` David A. Cobb
  0 siblings, 1 reply; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-09-04  6:11 UTC (permalink / raw)
  To: 'Gary V. Vaughan', Charles Wilson; +Cc: cygwin, libtool

> -----Original Message-----
> From: Gary V. Vaughan [ mailto:gvv@techie.com ]
> Sent: Sunday, September 03, 2000 2:05 PM
> To: Charles Wilson
> Cc: cygwin@sources.redhat.com; libtool@gnu.org
> Subject: Re: DLL naming conventions
> 

	<skipped>

> > It doesn't work for Michael's 'user 2' -- the guy who 
> normally runs in
> > cmd.exe/command.com, but relies on cygwin commands every once in a
> > while.  He doesn't use bash, but likes the cygwin-perl or grep every
> > once and a while.  User 2 will have the cygwin directories 
> somewhere in
> > her path -- but not necessarily first.
> 
> We could tell these people to put C:/cygwin/usr/bin at the front of
> their PATH...

This would not work, as user2 will be tell by cygwin to put
C:/cygwin/usr/bin at the front of their path, and by PW or Mingw32 to put
THEIR directory with DLLs in front of the path ;-(

> 
> > > Does cygwin ld use -rpath yet?  
> > 
> > I don't think so.  -rpath is something that ld.so uses; 
> Windows doesn't
> > have ld.so. Windows *always* loads dll's according to the following
> > search order:
> >    current directory
> >    app's load directory
> >    global executable search path
> > 
> > The only two exceptions I know of are:
> > 
> >   1) In Win2K, if there is a file called 'app.exe.local' in the same
> > directory as app.exe, then all dll's will be loaded from 
> the app's load
> > directory -- even if explicitly dlopened() with an absolute 
> path that
> > points elsewhere.  the .local. may also override the 
> 'current directory'
> > part of the search order listed above, but I'm not sure.
> 
> Holy cr@p! What happened to simplicity?  If Bill has decided that he
> can't understand how to write a decent shared library system, and
> want's to relegate dll's to LoadLibrary() objects, why doesn't he just
> say so?  Wouldn't it be easier to statically link a Win2k program that
> twiddle about with all this .local mess?

Anyway this would not work; th eproblem is not getting the DLLs that are in
the same directory as the EXE, but selecting th eright DLL when it is not
there :-)

> 
> >   2) You can put something called 'AppPath' in the 
> registry, which will
> > influence the directories that are searched. I don't know 
> where in the
> > list above that the directories listed in the 'AppPath' key are
> > inserted.
> 
> This sounds promising.  I'll see if I can find any details on it.

This could efefctively be the solution, if Bill didn't manage to render it
unusable :-).

> 
> > > I am prepared to work on having libtool do the right thing as far
> > > as possible. 
> > 
> > What was the right thing, again?  :-)
> 
> Based on our conversation so far:
> 
>   * When building a libtool (.la) library, create libfoo.la,
>     libfoo<iface>.dll, libfoo.dll.a and libfoo.a, where:
>       - <iface> is the earliest fully supported interface number
>       - libfoo.dll.a is the import library for libfoo<iface>.dll
>       
>   * When installing a libtool (.la) library:
>       - libfoo.la goes to $prefix/lib
>       - libfoo<iface>.dll goes to $prefix/bin
>       - libfoo.dll.a goes to $prefix/lib
>       - libfoo.a goes to $prefix/lib
>       
>   * When linking against libfoo.la
>       - use libfoo.dll.a unless -static or -all-static 
>       - otherwise use libfoo.a
> 
>   * When linking against -lfoo
>       - if libfoo.la is found, behave as above
>       - else let ld (or gcc) do its thing
> 
> Which is especially cool, because I don't think I need to worry about
> dealing with direct linkage to dlls (I can just punt and let gcc/ld do
> the hard work) which removes a whole pile of spaghetti where I had to
> cope with compiling the impgen code correctly in cross compilation
> environments!

This scheme seems to work for me also; the only think I would like to have,
when libtool is used to build a DLL, is the ability to say to libtool:
please name the DLL itself <something>foo.dll instead of the default
libfoo.dll; even if cygwin insists that there libraries should be named
libfoo.dll, so that they may conflict with others, I would be able to name
my own dlls with some unique name so that I can blame cygwin if my customers
have problems with conflicting libraries :-)

> 
> > > By default libtool always searches for a dll to link against and
> > > generates the implib on the fly if a suitable one is found.
> 
> This won't be necessary under the new scheme =)O|
> 
> > There are occaisions where you want to link to an import lib in
> > preference to a dll -- for instance, libcygwin.a is an 
> import lib, but
> > contains initializer code and actual function 
> implementations for some
> > functions that are not included in the dll itself.  If you 
> attempt to
> > link directly to cygwin1.dll, the link fails because those 
> things are
> > missing from the virtual on-the-fly implib.
> 
> I didn't know about that.  Thanks.

That a thing that I also have to do for some of my DLLs.

> 
> > But where do you put the dll?  It has to go into the 
> executable PATH so
> > that the windows loader can find it.  Do you copy it into 
> /usr/lib, so
> > that the default ld search path will find it?  Do you add 
> /usr/bin to
> > the linktime library search path (-L/usr/bin)?  Perhaps a symlink in
> > /usr/lib, pointing to /usr/bin/libfoo.dll is all you need. 
> > 
> > However!!! Ld uses the following library name search order 
> when hunting
> > for -lfoo:
> > 
> >   libfoo.dll.a
> >   foo.dll.a
> >   libfoo.a  <<<< NOTE!!
> >   libfoo.dll
> >   foo.dll
> 
> Or that.  Thanks again!  Libtool already provides --disable-static if
> the user wants to build and install only the dll parts of the library.

Why this should have to avoid generating and installing libfoo.dll.a ?

> 
> For this to work (that is, in order for me to be able to punt 
> to gcc/ld
> in the majority of cases) I must generate dll names that will be
> found, so the cygfoo.dll idea is out (Sorry Paul!).

Not sure; we are in development environment, so we may expect the user to
either have the import libraries fro DLL they want to link against (anyway
they will need proper include files, don't they) and if the package is
somewhat broken (i.e. not libtool-generated), and do not provide import
libraries, then it better have its libraries called libfoo.dll, or even just
foo.dll as this may be a native win32 library and no one of those even knows
of the "standard" lib prefix :-)

In fact IMHO the main cases where we must link directly against DLLs without
an import library is for native library that do NOT get a lib prefix. Cygwin
libtool-generated DLLs will have import libraries, so no problem at all.
 
> 
> Although this doesn't help ``User 2'' very much, he is no worse off
> than before if I change libtool's behaviour in this way.  Here's a
> thought:  For each dll using application linked, I could have libtool
> install a .bat script to C:/cygwin/launch (or similar) which would set
> the PATH environment correctly for that application.  As long as
> ``User 2'' has the launch directory higher in his PATH than the actual
> binary directory, this would guarantee correct dll selection.

Are you sure I can execve("xyz" ...) from mingw32 (or cygwin) and
effectively execute your BAT wrapper? even if I were to accept the
performance penalty in production code :-(

> 
> This would give ``User 1'' many of the advantages shared libraries
> offer on Unix, without sinking into DLL Hell.  Assuming that everyone
> buys into it.  The only reason shared libraries work properly on Unix
> is that everyone has to agree to conform to the runtime loader's
> versioning scheme -- so don't give some excuse about ``if we don't
> want to change the core cygwin dll's to conform this won't work''.  On
> my linux box, I can move my libc around or drop several incompatible
> versions of libc into my filesystem, and my applications will stop
> loading the intended libraries too.  No surprises there!

Some! I remember a lot of problems with people mixing libc5 and libc6, and
even some of my libc6 programs just crashing randomly till I discover that
glibc-2.0 and glibc-2.1 were incompatible, but were both considered as libc6
without any complain from the dynamic linker. And that do not seems too much
surprising t me as libc5 and libc6 could be seens as PW and CYGWIN, while
glibc-2.0/glibc-2.1 is cygwin-1.1.0/cygwin-1.1.4.

And anyway, as you say, the UNIX situation is a lot better than the WIN32
one because there IS some conventions that you MUST follow to have your code
work, while on WIN32 there is none; that's why I would like a lot to have
some convention defined to help solve this 'incompatible environment'
problem that is like the 'libc5/libc6' one, but worse because I do not think
PW is going to replace cygwin, nor the opposite, whereas libc6 has replaced
libc5.

Anyway, I could live with cygwin keeping the lib prefix, as I recompile most
of the libraries I use to add some local changes so anyway, as far as I'm
concerned, I would not use cygfoo.dll by my_foo.dll, as far as libtool
allows me to do so :-)

Regards,

	Bernard


--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* Re: DLL naming conventions
@ 2000-09-01  4:49 Tor Lillqvist
  2000-09-01  6:47 ` Charles S. Wilson
  0 siblings, 1 reply; 81+ messages in thread
From: Tor Lillqvist @ 2000-09-01  4:49 UTC (permalink / raw)
  To: cygwin

"Charles S. Wilson" <cwilson@ece.gatech.edu> writes:

> 2) on interface (API/ABI) versioning
>  http://www.gnu.org/software/libtool/manual.html#Versioning

Note that this document talks about stuff that AFAIK requires
cooperation from the runtime dynamic linker, that it knows how to
search for a suitable version of a shared library. No such dynamic
linker on Win32, alas.

(Writing a Unix-like (or should one say ELF-like?) dynamic linker for
Win32 would be an interesting exercise, of course.)

--tml

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-08-31 23:56 Bernard Dautrevaux
  2000-09-01  6:40 ` Charles S. Wilson
  0 siblings, 1 reply; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-08-31 23:56 UTC (permalink / raw)
  To: 'Egor Duda', Chris Faylor; +Cc: Charles S. Wilson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2794 bytes --]

> -----Original Message-----
> From: Egor Duda [ mailto:deo@logos-m.ru ]
> Sent: Thursday, August 31, 2000 6:44 PM
> To: Chris Faylor
> Cc: Charles S. Wilson
> Subject: Re: DLL naming conventions
> 
> 
> Hi!
> 
> Thursday, 31 August, 2000 Chris Faylor cgf@cygnus.com wrote:
> 
> >>(This  argument is based on the supposition that dll's with the same
> >>name  will  always  conflict.  If  I'm wrong about that supposition,
> >>please correct me...as I stated above, I'm a bit confused as to when
> >>dll's will conflict and when they will not)
> 
> CF> Can someone write a simple test to verify Windows 
> behavior?  It's pointless
> CF> to argue about what Windows does with DLLs if we don't 
> know for sure.
> 
> with ease. all you need is two different builds of cygwin1.dll, sh.exe
> and  strace.exe  i've  used  my  yesterday's build and current one.
> 1. create 2 directories -- say c:\test\1 and c:\test\2
> 2. copy first cygwin1.dll to c:\test\1 and other build to c:\test\2
> 3. copy sh.exe and strace.exe into both c:\test\1 and c:\test\2
> 4. start cmd.exe, cd c:\test\1, strace -o sh.log sh
> 5. start cmd.exe, cd c:\test\2, strace -o sh.log sh
> 6.  look  at the string containing "DLL build" in c:\test\1\sh.log and
> c:\test\2\sh.log
> 
> voila
> 

Note that there *is* a solution on Windows98 and Windows2000 (at least
reading Microsoft prose in MSDN Library) named "side-by-side DLLs"; however
this does *not* work on NT nor on 95 :-(

The idea is either by special arrangment when building the application (not
very practlical when porting) or by creating a file named "myapp.exe.local"
in the same directory than "myapp.exe", Windows will link the DLLs it found
in the same directory as "myapp.exe" BEFORE looking elsewhere, and even
before looking if it already has a copy of this DLL in memory.

This helps solve what Microsoft calls "DLL Hell", but is a typically kludgy
MS solution (especially the ".local" stuff). Some DLLs cannot run
side-by-side; their list is in
"HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs"; it's not
clear however if one can add it's own DLLs to this list, for example
cygwin1.dll that cannot be run side-by-side as it shares data cross-process.

HTH

	Bernard

PS: IOW the behaviour we were talking about was documented and Microsoft
itself discover that, although it allow for better performances, it may be
problematic :-)

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-08-31 23:55 Bernard Dautrevaux
  0 siblings, 0 replies; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-08-31 23:55 UTC (permalink / raw)
  To: 'cygwin@sources.redhat.com'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4379 bytes --]

> -----Original Message-----
> From: Chris Faylor [ mailto:cgf@cygnus.com ]
> Sent: Thursday, August 31, 2000 5:53 PM
> To: Chris Faylor
> Cc: paul-ml@is.lg.ua
> Subject: Re: DLL naming conventions
> 
> 
> On Thu, Aug 31, 2000 at 02:14:56PM +0300, Paul Sokolovsky wrote:
> >From: Paul Sokolovsky <paul-ml@is.lg.ua>
> >Chris Faylor <cgf@cygnus.com> wrote:

> 
> The reason that we use "cyg" on the tcl libs is that they 
> contain local
> cygwin mods, making those DLLs different from the ones already
> distributed by Scriptics.

Exactly why I would like to have cygfoo.dll for library foo compiled on
cygwin, to differentiate from libfoo.dll (or was it foo.dll) as provided on
the official distribution on foo.org site :-)

> 
> I think it is unlikely that a person will be attempting to 
> use both the
> cygwin and mingw libpng DLLs at the same time and have absolutely no
> desire to engage in a massive DLL renaming campaign, especially given
> the attendant confusion that will be a guaranteed result.

Now but the fancy GIMP on NT package use some libtiff.dll and some other
cygwin ported package will use the cygwin-compiled libtiff.dll; if they are
both in the path we WILL have problems ;-(

> 
> >At the same time, GNU has convention of prefixing libraries with
> >'lib'.
> 
> This is a longstanding *UNIX* convention.  It's not a GNU convention.
> 
> >Let's recommend for cygwin use prefix 'cyg' instead (for *dlls
> >only*) - it is consistent with existing practise. As for mingw32,
> >we'll leave it 'lib' - after all, it's the most native GNU-Win32
> >target, let it use defualt conventions. All other, being
> >superstructures on win32, to use distinguishable naming scheme".
> 
> If every package maintainer wants to follow this (to me) 
> ill-considered
> plan, that's fine.  Just as long as I don't have to support it.
> 
> IMO, cygwin is supposed to be UNIX for Windows.  If people are looking
> for libraries, they don't look for 'cygreadline.dll' they look for
> 'libreadline.dll'.

Sure? I, as a longtime SUN user and Linux user would rather search
libreadline.so.X.Y but my HP friends will rather look for libreadline.sl :-)

So long for the UNIX-on-Windows historical compatibility... searching for
cygreadline.dll is not worst and has the advantage of being explicit!

> 
> >CF> Expecting cygwin to change its conventions is just a tad
> >CF> bit arrogant, don't you think?
> >
> >Chris, you often ask strange questions.  If, I say - if, 
> someone would
> >propose to change its conventions, I'd first listen one's reasoning
> >before making my opinion whether it is arrogant or not.  But what
> >relation this has to our present conversation?
> 
> I was under the impression that you'd already submitted your 
> reasoning.
> Apparently you're having some kind of problems with library versioning
> with your own project so your solution is to change cygwin's usages.
> I'm sure that it must have occurred to you that cygwin has been using
> the same conventions for years and that suddenly changing things now
> will lead to confusion.  I don't see any plan for dealing with the
> confusion, however.
> 
> I assume that if your plan is implemented you'll just disappear from
> this mailing list and leave others to deal with the fallout.
> 
> Perhaps this assumption is invalid, but I don't see you answering any
> questions here on a day-to-day basis.
> 
> However, it's all moot.  The base cygwin release that I control is
> not going to change any of its naming conventions.  If all of the
> other contributors want to adopt a new plan, that's fine with me.
> Isn't free software wonderful?
> 
> However, I will again state that I don't think that any change is
> necessary.

Don't know what to understand here: does that mean that if users have
problems with cygwin they are urged to try some other UNIX-on-Windows layer
rather than explain their problems and see how it could be found some
acceptable and effective solution?

Regards,

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* Re: DLL naming conventions
@ 2000-08-31 12:41 Earnie Boyd
  2000-08-31 12:43 ` Chris Faylor
  0 siblings, 1 reply; 81+ messages in thread
From: Earnie Boyd @ 2000-08-31 12:41 UTC (permalink / raw)
  To: cygwin

--- Chris Faylor <cgf@cygnus.com> wrote:
> 
> That means that the (so far hypothetical) DLL problems should be
> solvable by keeping the DLLs in the same directory as the executables.
> 

Great news!  So my earlier suggestion stands to good effect.  Unofficial Cygwin
packages should install in --prefix=/usr/local/packages.x.x.x.  Official Cygwin
packages should install in --prefix=/usr.  No need to prefix, suffix or munge
the names.

Done,

=====
---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-08-31  6:40 Earnie Boyd
  2000-08-31  8:47 ` Charles S. Wilson
  0 siblings, 1 reply; 81+ messages in thread
From: Earnie Boyd @ 2000-08-31  6:40 UTC (permalink / raw)
  To: Bernard Dautrevaux, 'Charles Wilson'; +Cc: Paul Sokolovsky, cygwin

--- Bernard Dautrevaux <Dautrevaux@microprocess.com> wrote:
> > -----Original Message-----
> > From: Charles Wilson [ mailto:cwilson@ece.gatech.edu ]
> > Sent: Wednesday, August 30, 2000 9:16 PM
> > To: Bernard Dautrevaux
> > Cc: Paul Sokolovsky; cygwin@sources.redhat.com
> > Subject: Re: DLL naming conventions
> > 
> > 
> > <<warning. this message is controversial. please read the entire thing
> > before responding...>>
> 

As Chris already pointed out, the solution to this for Cygwin is:

For any official cygwin/latest or cygwin/contrib package release the:
       package should be configured with --prefix=/usr
       .dll should goto /usr/bin.
       .a   should goto /usr/lib.
       no versioning controls on the names of the libraries.

For any unoffical cygwin package release the:
       package should be configured with --prefix=/usr/local/package-x.x.x.
       .dll should goto /usr/local/package-x.x.x/bin.
       .a should goto /usr/local/package-x.x.x/lib.
       .exe should goto /usr/local/package-x.x.x/bin.
       .info should goto /usr/local/package-x.x.x/doc/info.
       man files should goto /usr/local/package-x.x.x/doc/man.
       html files should goto /usr/local/package-x.x.x/doc/html.
       etc.
       no versioning controls of the names of the libraries unless the
libraries use shared memory regions that may conflict with other libraries of
the same name.

Cheers,

=====
---
   Earnie Boyd: < mailto:earnie_boyd@yahoo.com >
            __Cygwin: POSIX on Windows__
Cygwin Newbies: < http://gw32.freeyellow.com/ >
           __Minimalist GNU for Windows__
  Mingw32 List: < http://www.egroups.com/group/mingw32/ >
    Mingw Home: < http://www.mingw.org/ >

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-08-31  4:22 Bernard Dautrevaux
  0 siblings, 0 replies; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-08-31  4:22 UTC (permalink / raw)
  To: 'Charles Wilson', Bernard Dautrevaux; +Cc: Paul Sokolovsky, cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 9578 bytes --]

> -----Original Message-----
> From: Charles Wilson [ mailto:cwilson@ece.gatech.edu ]
> Sent: Wednesday, August 30, 2000 9:16 PM
> To: Bernard Dautrevaux
> Cc: Paul Sokolovsky; cygwin@sources.redhat.com
> Subject: Re: DLL naming conventions
> 
> 
> <<warning. this message is controversial. please read the entire thing
> before responding...>>

I read it all, and I have to confess one thing: I took for granted that when
talking of versioning DLLs we were talking of the "interface" version, that
is compatibility versioning. 

This mistake was aggravated by the fact that we use 4-figures version
numbers, where the first number is the product generation -- total
incompatibility even at the user level --, the second correspond to
incompatible interface changes -- but source code compatibility --, the
third one 
is changed when compatible infercae changes are done and the last one is for
bugfix releases. 

So when saying having both X.Y and X.Z it was incompatible libraries (though
you can just recompile without any source code change), not minor
versionning. 

So I agree with you, we need libpng.dll and libpng2.dll (even if I would
call the earlier one libpng1.dll for consistency, but that's a non-problem),
but having libz123a.dll would be  *huge* nuisance.
 
Note that I need to use 2 figures for the incompatible changes of my
packages as I write a lot of things in C++ and object compatibility is
sometimes more difficult to achieve than source compatibility ;-(, so I use
one figure for the source-level incompatible changes, 1 for the
source-level-compatible but nevertheless object-level incompatible changes
and two others for compatible interface change and bug fixes without any
interface change (I was going to write "without semantics change" but indeed
correcting a bug change the semantics :-)).
> 
> Bernard Dautrevaux wrote:
> > 
> > I agree 100%; I port a lot of software to Windows and would 
> *hate* having to
> > change -ltiff to -lcytiff everywhere :-)
> > 
> > However having problems because I need some version of the 
> DLL coming from
> > some provider (e.g. the cygwin-compatible tcl DLL) and 
> picking another one
> > just because they both are named tcl.dll is just a 
> nuisance. All my DLLs are
> > usually named as <vendor><lib-name><version>.dll with 
> import libraries named
> > just lib<lib-name>.a (as you propose also below).
> 
> I knew I wasn't the first to think of this...
> 
> > 
> > > One less intrusive possibility I have thought of is:
> > >   import lib:  libtiff{ver?}.dll.a (built with
> > > --dllname=cyglibtiff{ver?}.dll)
> > >   dll       :  cyglibtiff{ver?}.dll
> > 
> > I usually do just that with my own DLLs :-) Note that I 
> NEVER put version
> > numbers on the import libraries and ALWAYS put them on dll 
> themselves, so
> > that I can have tools using several versions of the DLL 
> installed at once
> > without any problem (as long as my DLLs do not share data 
> between instances
> > like cygwin itself where this will clearly broke apart).
> > 
> > > I'm not really in favor of using version numbers on shared
> > > libs,
> > 
> > I always do this, for reasons explained below :-)
> 
> To me, there are two benefits to dlls:
>  
> 1) less duplicated code to store & download (compared to 
> static linking)
> 2) update a dll to incorporate bugfix -> instant update of all linked
> applications
> 
> If you version dll's, you lose #2 completely.  Disk space is cheap and
> connection speed is getting faster all the time, so #1 is kinda
> pointless these days IMO and will become more pointless in the future.
> 
> > 
> > > since you'd also have to version the import libs also and then use
> > > symlinks a
> > > la unix....but this should be discussed on the list.
> > >    libtiff.dll.a -> libtiff{latest-ver}.dll.a
> > 
> > Why? usually the compile environment is quite well 
> controlled so that the
> > header files, import libraries and DLLs are all in sync, so 
> there is no need
> > to version the import library; however it is interesting to 
> version the DLL
> > itself to avoid having to recompile everything (even 
> obsoleted stuff) each
> > time a new version fo the DLL gets out.
> 
> I think versioning import libs is just silly -- but I threw 
> it out there
> to see if it would stick.

OK :-)

> 
> Why would you have to recompile an app if a new (but compatible) DLL
> comes out?  You'd only have to recompile if (a) you linked by ordinal
> instead of by name (AFAIK, cygwin-ld only links by name -- you can't
> link by ordinal) AND the library developer didn't use consistent
> ordinals, or (b) the DLL had an incompatible interface -- e.g. a major
> soname change.
> 
> However, versioning dlls down to the micro-revision level will cause a
> real headache, fast:
> 
> Q: why doesn't package X work? It says it requires zlib and I have it
> installed...
> A: you need version x.x.A of zlib, you probably have version x.x.B
> Q: okay, I removed version x.x.B and installed version x.x.A from the
> archived tarballs, and now package Y is broken
> A: well, package Y needs version x.x.B -- so you need to have both
> zlib-A and zlib-B installed if you want BOTH package X and 
> package Y to
> work.  Be sure install version x.x.A of zlib first, and version x.x.B
> last so that the import lib will link to the newer version of 
> zlib when
> you build package Z...
> 
> Aaarrrgghhh!!!!!!

Me too! 

> 
> You might as well link statically and forget you ever heard of DLLs.
> It'll sure cut down on support headaches.

Sure but complicates a lot updates of existing installs, as you pointed out
:-)

> 
> > 
> > Note that I'm biased at writing supported code, where I 
> want to avoid as far
> > as possible the risk of some code working in my environment 
> because I pick
> > version X.Y of some DLL and failing at the customer site, 
> perhaps at the
> > other end of the world (actually not yet really, just at 
> the other end of
> > France, but we can dream :-)) because he picks version 
> X.Y+1 from the
> > evaluation of some new stuff I do not have installed yet on 
> the support
> > people machine :-(
> 
> Yeah...but you're trying to support ONE application.  Since 
> I'm porting
> libraries to cygwin, I'm concerned about supporting ALL packages that
> depend on those libraries -- both their developers and their 
> (sometimes
> clueless) users.
> 
> I also don't want developers of package XYZ complaining to me 
> or the to
> the list because XYZ depended on version a.b of some library, and I
> removed it from the standard installation and put version a.b+1 on
> cygwin to catch some bugfixes.  "Please put a.b back -- we'd 
> prefer that
> you did extra work and supported 83 old revisions of each of your 27
> libraries, rather than us using and supporting the use of the most
> bugfree version of your library...we like bugs..."
> 
> Not gonna happen. At least, not by me. I hate to put it this way, but
> unversioned libraries (other than incompatible interface 
> changes) FORCE
> developers of other packages to use & support the most recent, most
> bugfree version of the libraries.  I'm NOT gonna get sucked into
> supporting all the old revisions of every library I've 
> ported.  I've got
> enough to do answering the questions about only the most recent
> versions...
> 
> If someone else wants to take over maintainership of the umpteen
> libraries I've ported so far, and version 'em -- fine.  But 
> don't expect
> me to help answer the thousands of FAQs that'll suddenly show 
> up on the
> list.  Unless somebody comes up with a really good argument for
> versioned libs (beyond the *necessity* imposed by incompatible
> interfaces -- I'll grant that one) AND can explain how to minimize the
> support difficulties.
> 
> > 
> > However I'm supporting strongly the ability of having old 
> and new versions
> > of tools working together on the same machine; for a long 
> time I avoided
> > DLLs just for that but with versioned DLLs I can use them 
> and my execs are a
> > lot lighter :-)
> 
> Until you neglect to upgrade to the newer versioned DLLs, and have to
> ship the old versions of the versioned dlls to everybody who uses your
> app.  Then your exec download is much heavier.
> 
> To me, the absolute best #1 *benefit* -- not drawback -- of DLLs and
> shared libs in general is that you can 'slipstream' update 
> all dependent
> apps without recompiling. 

I 100% agree; the volume of code is only slightly important fro me too; it's
just a bit faster to burn a 400Meg CDROM than a 600 one :-) 

The only reason I'm switching to DLLs is the upgradeability they bring me.

> 
> sure, when there's a major, incompatible change in the interface
> (so-name, in unix parlance) we might have to revisit this issue.  For
> instance, libpng-2.x.x (still in alpha) is incompatible with older
> apps.  It'll definitely have to be libpng2.dll. But for micro- and
> minor- version changes, I don't want to deal with versioned 
> dlls and the
> INEVITABLE support NIGHTMARE that will ensue.  You think non-versioned
> DLLs are a support problem? just wait...

Sure minor/micro versioned DLLs would be real nightmare! 



> 
> --Chuck
> 

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* RE: DLL naming conventions
@ 2000-08-30  9:45 Bernard Dautrevaux
  2000-08-30 12:13 ` Charles Wilson
  0 siblings, 1 reply; 81+ messages in thread
From: Bernard Dautrevaux @ 2000-08-30  9:45 UTC (permalink / raw)
  To: 'Charles Wilson', Paul Sokolovsky; +Cc: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5526 bytes --]

> -----Original Message-----
> From: Charles Wilson [ mailto:cwilson@ece.gatech.edu ]
> Sent: Wednesday, August 30, 2000 4:52 PM
> To: Paul Sokolovsky
> Cc: cygwin@sources.redhat.com
> Subject: Re: DLL naming conventions
> 
> 
> Paul Sokolovsky wrote:
> > 
> > Hello cygwin,
> > 
> >   Existance of several GNU targets based on incompatible underlying
> > libraries brings (or will bring soon) problem of clashes 
> between their
> > components. Mere installing software build with each of them into
> > separate directory and setting PATH to one of the in per-session
> > manner is not flexible since often one piece of software absent in
> > that or another distribution. Of particular importance here is
> > clashing of DLLs which is espicially hard to detect for end 
> users. It
> > would be nice if there were some convention for naming DLLs 
> build for
> > particular target. Cygwin did that for a some time, for example,
> > native builds of Tcl/Tk, etc. used to have 'cyg' prefix. However,
> > latest additions seem not to follow this practise.
> 
> Yup, I know.  Most the latest additions which have dll's were 
> ones that
> I ported.  I did not want dependent packages to be required to modify
> their makefiles to use '-lcygtiff' or worse yet, '-lcygtiff35' when a
> plain '-ltiff' is already there and works.  The tcl/tk stuff is a
> special case, I believe, since it's a wierd half-native/half-cygwin
> build...

I agree 100%; I port a lot of software to Windows and would *hate* having to
change -ltiff to -lcytiff everywhere :-) 

However having problems because I need some version of the DLL coming from
some provider (e.g. the cygwin-compatible tcl DLL) and picking another one
just because they both are named tcl.dll is just a nuisance. All my DLLs are
usually named as <vendor><lib-name><version>.dll with import libraries named
just lib<lib-name>.a (as you propose also below).


	<skipped>

> > 
> >   Will it be possible to re-consider this matter and if it applies,
> > recommend to follow it? 
> 
> Maybe.  But I won't even accept patches to do that to the packages I
> maintain until the dependency problems are resolved, or folks on the
> list agree that the inevitable hassles and constant FAQs: 'you need to
> change -ltiff to -lcygtiff in the makefile...' are worth it.
> 
> One less intrusive possibility I have thought of is: 
>   import lib:  libtiff{ver?}.dll.a (built with
> --dllname=cyglibtiff{ver?}.dll)
>   dll       :  cyglibtiff{ver?}.dll
> 
> If this is done, then you no longer can link directly to the dll
> (without changing the makefile to say '-lcyglibtiff{ver}',  but
> ordinarily you'd link using the import lib so everything would be ok,
> and you can still use '-ltiff' in the makefile.
> 

I usually do just that with my own DLLs :-) Note that I NEVER put version
numbers on the import libraries and ALWAYS put them on dll themselves, so
that I can have tools using several versions of the DLL installed at once
without any problem (as long as my DLLs do not share data between instances
like cygwin itself where this will clearly broke apart).

> I'm not really in favor of using version numbers on shared 
> libs, 

I always do this, for reasons explained below :-)

> since you'd also have to version the import libs also and then use 
> symlinks a
> la unix....but this should be discussed on the list.
>    libtiff.dll.a -> libtiff{latest-ver}.dll.a

Why? usually the compile environment is quite well controlled so that the
header files, import libraries and DLLs are all in sync, so there is no need
to version the import library; however it is interesting to version the DLL
itself to avoid having to recompile everything (even obsoleted stuff) each
time a new version fo the DLL gets out.

Note that I'm biased at writing supported code, where I want to avoid as far
as possible the risk of some code working in my environment because I pick
version X.Y of some DLL and failing at the customer site, perhaps at the
other end of the world (actually not yet really, just at the other end of
France, but we can dream :-)) because he picks version X.Y+1 from the
evaluation of some new stuff I do not have installed yet on the support
people machine :-(

However I'm supporting strongly the ability of having old and new versions
of tools working together on the same machine; for a long time I avoided
DLLs just for that but with versioned DLLs I can use them and my execs are a
lot lighter :-)

> 
> > More importantly, it can be automatically
> > supported on appropriate level (in libtool).
> 
> No, it can't.  Currently, libtool itself doesn't support *building*
> dlls.  Also, you are assuming that every package that depends on
> dll-ized libraries uses libtool in its build process.  While 
> that would
> be great, it is not true.  Unfortunately, *very* few packages use
> libtool, in my experience.

I think libtool is quite irrelevant here; even manually we can do all that
without too much of a hassle, as long as we have sorted out the clumsy
windows-dll building mechanism, but due to the discussion I take that for
granted :-).

Regards,

		Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingéniérie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 81+ messages in thread
* DLL naming conventions
@ 2000-08-30  3:36 Paul Sokolovsky
  2000-08-30  7:26 ` Chris Faylor
                   ` (2 more replies)
  0 siblings, 3 replies; 81+ messages in thread
From: Paul Sokolovsky @ 2000-08-30  3:36 UTC (permalink / raw)
  To: cygwin

Hello cygwin,

  Existance of several GNU targets based on incompatible underlying
libraries brings (or will bring soon) problem of clashes between their
components. Mere installing software build with each of them into
separate directory and setting PATH to one of the in per-session
manner is not flexible since often one piece of software absent in
that or another distribution. Of particular importance here is
clashing of DLLs which is espicially hard to detect for end users. It
would be nice if there were some convention for naming DLLs build for
particular target. Cygwin did that for a some time, for example,
native builds of Tcl/Tk, etc. used to have 'cyg' prefix. However,
latest additions seem not to follow this practise.

  Will it be possible to re-consider this matter and if it applies,
recommend to follow it? More importantly, it can be automatically
supported on appropriate level (in libtool).

--
Paul Sokolovsky, IT Specialist
http://www.brainbench.com/transcript.jsp?pid=11135



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

end of thread, other threads:[~2000-09-06  2:28 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-04  5:31 DLL naming conventions Bernard Dautrevaux
2000-09-04  5:44 ` Robert Collins
2000-09-04  6:26   ` Corinna Vinschen
2000-09-04  7:23   ` Charles S. Wilson
2000-09-04  8:09     ` Charles S. Wilson
2000-09-04 11:03       ` Chris Faylor
2000-09-04 14:19     ` Robert Collins
2000-09-05 14:08     ` David A. Cobb
  -- strict thread matches above, loose matches on Subject: below --
2000-09-05  8:56 Earnie Boyd
2000-09-05  5:37 Earnie Boyd
2000-09-05  7:32 ` Egor Duda
2000-09-05  7:40   ` Larry Hall (RFK Partners, Inc)
2000-09-06  2:28     ` Egor Duda
2000-09-04  8:38 Bernard Dautrevaux
2000-09-04 13:59 ` Robert Collins
2000-09-05 14:38   ` David A. Cobb
2000-09-05 14:52   ` David A. Cobb
2000-09-05 15:08     ` Robert Collins
2000-09-04  8:18 Bernard Dautrevaux
2000-09-04  6:59 Bernard Dautrevaux
2000-09-04  6:11 Bernard Dautrevaux
2000-09-05 14:28 ` David A. Cobb
2000-09-01  4:49 Tor Lillqvist
2000-09-01  6:47 ` Charles S. Wilson
2000-09-02  6:56   ` Gary V. Vaughan
2000-09-02 11:36     ` Charles S. Wilson
2000-09-02 16:40       ` Gary V. Vaughan
2000-09-02 19:20         ` Chris Faylor
2000-09-02 21:23           ` Robert Collins
2000-09-02 22:56           ` Charles Wilson
2000-09-03  5:31           ` Gary V. Vaughan
2000-09-03  9:31             ` Chris Faylor
2000-09-03 10:32               ` Chris Faylor
2000-09-04  6:56               ` Gary V. Vaughan
2000-09-02 22:32         ` Charles Wilson
2000-09-03  5:29           ` Gary V. Vaughan
2000-09-03 12:40             ` Alexandre Oliva
2000-08-31 23:56 Bernard Dautrevaux
2000-09-01  6:40 ` Charles S. Wilson
2000-09-01  6:58   ` Larry Hall (RFK Partners, Inc)
2000-08-31 23:55 Bernard Dautrevaux
2000-08-31 12:41 Earnie Boyd
2000-08-31 12:43 ` Chris Faylor
2000-08-31 13:44   ` Charles Wilson
2000-08-31 14:14     ` Chris Faylor
2000-08-31 15:36       ` Charles S. Wilson
2000-08-31 15:44         ` Robert Collins
2000-08-31 15:51           ` Charles S. Wilson
2000-08-31 16:06             ` Robert Collins
2000-08-31 15:46         ` Tor Lillqvist
2000-08-31 17:19         ` Chris Faylor
2000-09-02  9:36           ` David A. Cobb
2000-09-02  9:43             ` Chris Faylor
2000-08-31 15:19     ` Michael Ring
2000-08-31  6:40 Earnie Boyd
2000-08-31  8:47 ` Charles S. Wilson
2000-08-31  8:56   ` Chris Faylor
2000-08-31  9:47     ` Egor Duda
2000-08-31 11:12       ` Chris Faylor
2000-08-31 11:33         ` Matt Minnis
2000-08-31 11:40           ` Chris Faylor
2000-08-31 13:01             ` Tor Lillqvist
2000-08-31  4:22 Bernard Dautrevaux
2000-08-30  9:45 Bernard Dautrevaux
2000-08-30 12:13 ` Charles Wilson
2000-08-30  3:36 Paul Sokolovsky
2000-08-30  7:26 ` Chris Faylor
2000-08-31  4:21   ` Re[2]: " Paul Sokolovsky
2000-08-31  8:56     ` Chris Faylor
2000-08-30  7:48 ` Charles Wilson
2000-08-30  7:52   ` Chris Faylor
2000-08-30  8:07     ` Norman Vine
2000-08-30  8:17       ` Charles Wilson
2000-08-30  8:19         ` Charles Wilson
2000-08-30 11:37         ` Chris Faylor
2000-08-30  8:11     ` Charles Wilson
2000-08-31  5:07   ` Re[2]: " Paul Sokolovsky
2000-08-31  8:58     ` Charles S. Wilson
2000-08-31 11:28     ` Re[2]: " Tor Lillqvist
2000-08-31 11:47       ` Chris Faylor
2000-08-31 12:07         ` Larry Hall (RFK Partners, Inc)
     [not found]   ` <20000831230822.R7695@demon.co.uk>
2000-08-31 18:58     ` Charles S. Wilson
2000-09-02  6:56       ` Gary V. Vaughan
2000-08-31 20:27 ` Charles S. Wilson

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).