libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: MSW DLLs support in libtool


From: Vadim Zeitlin
Subject: Re[2]: MSW DLLs support in libtool
Date: Sat, 13 Feb 2016 02:56:27 +0100

On Sat, 13 Feb 2016 00:38:15 +0100 Peter Rosin <address@hidden> wrote:

PR> On 2016-02-12 22:12, Vadim Zeitlin wrote:
PR> >  Several concrete questions in this thread asking for any benefits of the
PR> > current libtool behaviour went unanswered, but let me try once again
PR> > nevertheless: do you see any useful consequences of performing the check
PR> > for PIC when targeting Windows in libtool? If you do, what are they
PR> > exactly? And if you don't, why do you still think it should be done?
PR> 
PR> To this specific question, the things that I can think of is if two DLLs
PR> (or the app itself) links with slightly different versions of the same
PR> static library, that might cause strange bugs.

 Thanks, it's an interesting case and I didn't think about it. However
while it's true that bad things can/will happen in this case, wouldn't they
also happen if two DLLs link with the different versions of the same DLL?
It's not totally clear how would you set things up to make the build pick
two different versions of a static library, but  presumably the same could
be done for the import libraries too. Of course, only one DLL would be
effectively loaded into the process address space (unless you have two
import libraries with the same name corresponding to the DLLs with
different names, and if we're considering really perverse cases, why not?),
but one or the other DLL linking with it will crash if the two versions are
not ABI-compatible.

PR> If libtool should be in the business of protecting from such disasters
PR> is another matter...

 I don't think it should and I don't think it can. And I'm also pretty sure
that the current protection against this is, first, unintentional (because
there are surely more direct ways to check for this) and, second, if we
accept that forbidding linking with static libraries completely is worth
this protection in Windows DLL case, then it logically follows that we
should just never link with static libraries at all. And this is (luckily,
I don't want to give anybody any ideas...) not what libtool does.

 So I still think that the check for PIC dependencies under Windows is
useful. Do you, or anybody else, believe it is and can anybody think of any
practical example when it would be useful?

 Thanks,
VZ

Attachment: pgp8SY0fnelYP.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]