libphobos as .so?

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Thu Jul 19 02:01:53 PDT 2007


TomD wrote:
> Gregor Richards Wrote:
> 
>> TomD wrote:
>>> OK I figured out what you meant with "generally broken". Simple
>>> D-functions seem to work (though I did not check GC yet), but classes
>>> are a no-no. 
>>> gdc0.23 chokes on Phobos, but maybe 0.24 gets better.
>>>
>>> Ciao
>>> Tom
>> "Chokes on Phobos"? I've made .so's of Phobos before with GDC.
>>
>> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=43627
>>
> Like this:
> tom at Inges:~/d/phobos$ gdc -v -c object.d 
[snip]
> cc1d: ../../gcc-4.1.1/gcc/d/dmd/toobj.c:417: virtual void ClassDeclaration::toObjFile(): Assertion `classinfo->structsize == (0x3C+8)' failed.
> object.d:0: internal compiler error: Aborted
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> tom at Inges:~/d/phobos$ 
> 
> With the phobos sources that come with DMD1.018.  But thanks for the link.

You shouldn't combine DMD's phobos with GDC. The runtime library is a 
bit compiler-specific.
You should try it with the gphobos sources that are part of the GDC 
source tree, which should work just fine with GDC. (IIRC it also has 
some patches to make it more portable since Walter mostly seems to write 
phobos to work on 32-bit x86 Windows & Linux)
Complete gphobos sources don't seem to be included in the GDC binary 
distribution by the way, that just seems to contain a "header" module 
for object.d, for instance. (the phobos/internal/* directory is missing, 
including internal/object.d which contains the actual implementation)



More information about the Digitalmars-d mailing list