Manually linking druntime and phobos2

Leandro Lucarella luca at llucax.com.ar
Fri Jul 23 06:11:50 PDT 2010


Lars T. Kyllingstad, el 23 de julio a las 12:39 me escribiste:
> On Fri, 23 Jul 2010 06:50:08 -0400, Michel Fortin wrote:
> 
> > When manually calling the linker, which libraries should be linked with
> > a d object file? If I run dmd with the -v option on Mac OS X, I notice
> > dmd issues the following linker command:
> > 
> > gcc test.o -o test -m32 -Xlinker
> > -L/Library/Compilers/dmd2/osx/bin/../lib -lphobos2 -lpthread -lm
> > 
> > which includes library phobos2 but not druntime. I've made D for Xcode
> > link both phobos2 and druntime in the final executable; this cause no
> > problem on Mac OS X 10.6 (Snow Leopard) but I have a user on 10.5
> > (Leopard) who gets duplicate symbols in druntime and phobos2 because of
> > this.
> > 
> > So now I wonder, is druntime included into the phobos2 library? Is this
> > how it should be?
> 
> It seems that at least parts of druntime gets included in the Phobos 
> library.  Here is the line (200) from the Phobos makefile that builds the 
> file libphobos2.a:
> 
>   $(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)
> 
> The variable $(DRUNTIME) contains the path to libdruntime.a.  If it is 
> removed, Phobos still compiles just fine, so I suspect it shouldn't be 
> there.

If it's not there, you should linkk the final program agains both
libraries. The way it is now is like phobos2 included all druntime's .o
files on it. I remember some discussion about this (joining phobos and
druntime in the same lib) a while ago...

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
¿Cómo estais? ¿Cómo os senteis hoy 29 del membre de 1961 día en que
conmemoreramos la nonésima setima nebulización del martir Peperino
Pómoro junto al Rolo Puente en la ciudad de Jadad?
	-- Peperino Pómoro


More information about the Digitalmars-d mailing list