[Top][All Lists]

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

Re: [lmi] Forcing linking of the library modules (again)

From: Greg Chicares
Subject: Re: [lmi] Forcing linking of the library modules (again)
Date: Mon, 06 Oct 2014 14:59:43 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 2014-10-04 14:52Z, Vadim Zeitlin wrote:
> On Sat, 04 Oct 2014 13:20:57 +0000 Greg Chicares <address@hidden> wrote:
> GC> I'm willing to apply such a patch

Soon I'll apply your [snipped] patch.

> GC>   grep 'volatile bool\|ensure_setup' *.?pp
>  The search finds the following files:
> - {file_command,progress_meter,system_command}_wx.cpp: these are the files
>   that genuinely need the workaround.

I suspect that this became necessary only on 20140226T1537Z, when the
wx-dependent code was refactored and most of it moved into the 'skeleton'

> - {file_command,progress_meter,system_command}_c[gl]i.cpp: while these may
>   look similar at a first glance, they do *not* require any workaround,
>   because they are only included directly into the various executables and
>   are never part of a library which is then linked into an executable,
>   which is the only case in which MSVC linker bug manifests.

Okay. Someday these might be refactored, as the wx-dependent code was.

> - alert_{cgi,cli,wx}.cpp: this one doesn't need the workaround even for the
>   wx version, as it is directly linked into main_wx and wx_test targets and
>   so can never be discarded.

'main_wx.cpp' uses report_exception(), which requires 'handle_exceptions.hpp',
which uses some of the 'alert' code. That's why it happens to be linked.
That's unlikely to change.

> GC> instead, I've cloned this code:
> GC>   
> http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/include/wx/link.h?view=co
> GC> to provide lmi-specific macros in new header 'force_linking.hpp'.
>  I don't know if the above changes your opinion about the need for these
> macros and this header. If it does, we could simply remove it and use my
> original patch. If it doesn't, please use the attached patch instead.

It doesn't, so I'll use the patch you attached here. As noted above,
I can imagine a future refactoring of the CLI or even CGI binaries
that would require forced linking for them as well. I see no need to
perform that work at the moment, but retaining 'force_linking.hpp'
makes it easier if it ever needs to be done.

reply via email to

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