digitalmars.D - libphobos as .so?
- Tom Demmer <t_demmer web.de> Jun 22 2007
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 on. 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, Ciao Tom
Jun 22 2007