Problems with shared library (-fPIC) and tango

e-t172 e-t172 at akegroup.org
Sun Jul 6 06:57:42 PDT 2008


Sean Kelly a écrit :
> == Quote from e-t172 (e-t172 at akegroup.org)'s article
>> Sean Kelly a écrit :
>>> == Quote from e-t172 (e-t172 at akegroup.org)'s article
>>>> Lars Ivar Igesund a écrit :
>>>>> There is a ticket related to this somewhere. I believe I was told once that
>>>>> part of the problem is that _all_ of the runtime can't be part of the
>>>>> dynamic library, but that there needs to be a static portion too with at
>>>>> least main. The above issue may have more to do with the effect of PIC on
>>>>> the code though. It would be very good if it could be resolved.
>>>> IIRC, there is only one problem when trying to build Tango with -fPIC :
>>>> the garbage collector, which segfaults on collection. Fix the GC and you
>>>> have your Tango shared library.
>>> I believe this is an issue with the static data segments not being represented
>>> in the way that the GC expects in a shared library.  I really need to do some
>>> research to figure out how things are different in this instance.  Though if
>>> someone knows then that would be good too :-)
>> When I tried to build Tango in a .so (all Tango, not just the runtime),
>> there was another (much less important) problem: when the executable
>> starts, all the static main() functions of all modules were executed,
>> even if I didn't use them. This can be a problem. When I executed my
>> "Hello Word", I got messages about cluster initialization...
> 
> I'm not sure I understand.  The only module with a main() function
> should be in the runtime.  Did you mean static this()?  I'll admit
> that if so that's still pretty weird.

Sorry. I of course meant static this() (module constructors). This was a 
typo.



More information about the Digitalmars-d mailing list