July 11, 2004
Is it possible to compile Phobos as a dynamic (shared) library instead of a static? I'm trying this in the makefile:

libphobos.so: $(OBJS) internal/gc/dmgc.a linux.mak
gcc -shared -o $@ $(OBJS) $(ZLIB_OBJS) $(GC_OBJS) $(RECLS_OBJS)

But it gives me these errors:

internal/gc/gclinux.o(.data+0x0): multiple definition of `MAP_FAILED'
linux.o(.data+0x0): first defined here
/usr/bin/ld: libphobos.so: undefined versioned symbol name _d_throw@4
/usr/bin/ld: failed to set dynamic section sizes: Bad value

Does anyone know how to fix these, so that I can compile phobos to a dynamic library?


July 12, 2004
> Does anyone know how to fix these, so that I can compile phobos to a dynamic library?

From http://www.digitalmars.com/d/dcompiler.html section "Linux Bugs":

Shared libraries cannot be generated.