|
Boost Users : |
Subject: Re: [Boost-users] [Thread] Win32 TLS problem with dynamic libraries
From: Sergey Zakharchenko (szakharchenko_at_[hidden])
Date: 2012-10-29 03:31:05
2012/10/25 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>:
> Le 25/10/12 15:07, СеÑгей ÐаÑ
аÑÑенко a écrit :
>> I assume that I need to eliminate tss_pe.cpp from linkage,
>> but I don't seem to be able to. Adding a
>>
>> namespace boost { void tss_cleanup_implemented() {} }
>>
>> to one of the library's sources doesn't help, as it results in a
>> multiply defined symbol error (compiler MSVC2008 from
>> Express edition).
>
> there are some tickets on the Trac system concerning this issue in
> Boost.Thread. Unfortunately I have not yet a clear vision of what needs to
> be done.
> I don't promise you anything, but I would like to have enough time to fix
> these issues for next release.
JFYI: our current solution integrated into our build system (CMake, MSVC) is:
* Rename the Boost.Thread library into 'original_boost_thread'.
* Add a custom target named 'patched_boost_thread' which uses dumpbin
and lib utilities to delete just the tss_pe.obj object from Boost.Thread.
* Add a library called boost_thread which links to 'patched_boost_thread' and
contains a file named tss_pe.cpp which contains the aforementioned code
(essentially it's the 'null tss cleanup implementation').
I know it's perverted (no, patching the Boost.Thread source is not an option
for me), but it does exactly what seems to be the original intent: replace
the tss_pe.obj with a stub. Targets which don't need plugin functionality
can still link to original_boost_thread and (potentially) benefit from the
automatic cleanup.
Best regards,
-- DoubleF
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net