Steve Clamage wrote:
> On 09/09/08 09:35, Stefan Teleman wrote:
>>
>>
>> Steve Clamage wrote:
>>
>>> Apache libstdcxx is different -- it must be built for 
>>> single-threaded or MT use.
>>>
>>> Let's take the case where we provide only an MT version of the 
>>> runtime library.
>>>
>>> I'm not clear on the consequences of linking code compiled without 
>>> -DRE_ENTRANT with MT code. Is that always safe? If so, maybe the 
>>> only issue would be performance. (We don't yet know whether 
>>> performance is an issue.)
>>
>> We can force stdcxx into thinking it's always MT, even for those 
>> cases where the user application hasn't passed -mt -D_REENTRANT to 
>> the compiler (by secretly raising _RWSTD_REENTRANT in the internal 
>> config.h file).
>
> That won't help the case of modules that don't include headers from 
> libstdcxx, or that include system headers before including libstdcxx 
> headers.
>
> My original question remains: Is it safe to mix .o files compiled with 
> and without -D_REENTRANT ?

I believe so, at least in Solaris 10 and later.  As far as I can tell, 
the only thing that -D_REENTRANT does is make some additional prototypes 
visible, required for POSIX conformance.  I don't think it changes 
anything in the actual resulting binary.

    -- Garrett
>
> ---
> Steve Clamage, stephen.clamage at sun.com


Reply via email to