gdc-4.5 testing

Iain Buclaw ibuclaw at ubuntu.com
Wed Dec 22 11:31:31 PST 2010


== Quote from Anders F Björklund (afb at algonet.se)'s article
> Iain Buclaw wrote:
> >>> AFAIK both shared libraries and x86_64 code have been working
> >>> for years with GDC, even though that is not the case with DMD.
> >> But you can't link shared obj to static lib (Phobos), except on i386 - so
> >> you really can't use shared obj on x86_64 (if you need phobos).
> >
> > As far as I'm aware, the #1 reason why (for GDC, at least) Phobos can't be
> > compiled as shared is because of inline asm clobbering the PIC register (EBX
on
> > i386). Because we're not smart enough (LDC likely suffers from this also), in
> > some instances EBX can be wrongly marked as being clobbered too.
> Ah, OK. That sounds like a different problem than "can't link"...
> Does this also affect other shared libraries, without inline asm ?

Nope, GCC produces code in such a way that this doesn't happen. As far as I'm
aware, only __asm__ statements can throw PIC-related compiler errors for reasons
I've already stated.

> Compiling Phobos as a shared library also seems to be a somewhat
> different issue from compiling user D code as a shared library.
> --anders

Seems related to me, from quote: "But you can't link shared obj to static lib
(Phobos)"


More information about the Digitalmars-d mailing list