www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - libphobos as .so?

Hi all,
I am trying to compile and link Phobos under Linux to a shared library. 
So far I found to problems: The minor one is a glitch in the design:
std/gc.d and internal/gc.d go into libphobos.a with a duplicate symbol.
This is OK because ar silently overwrites the first definition with the later
For the shared lib it is sufficient just to drop the gc.o from std/gc.d from
the link line. The fundamental problem is "throw". in internal/deh2.d the
function _d_throw(Object) is declared extern(Windows), which gives the symbol a
" 4" decoration. This means for a shared ELF lib that it is version 4. 
Is there a reason why it has to have Windows calling conventions?
If this could be changed to Pascal and the (probably hardcoded) call to
_d_throw 4 at every "throw", building phobos as a shared lib should work.

Or, is there a way to convince ld that "foo x" is just a simple symbol?

Thanks a lot,

Jun 22 2007