digitalmars.D.learn - Compile a .so
- Sebastian (3/3) Apr 07 2007 hi,
- Clay Smith (4/7) Apr 08 2007 Use GDC maybe?
- nobody nowhere.nonet (11/13) Apr 28 2007 This isn't handled by a compiler, but the linker, ld. First,
- Frits van Bommel (7/20) Apr 29 2007 Are you sure? Shouldn't the compiler generate position-independent code?...
hi, is possibile to compile .so for linux and for mac, with D? if true how i can do that? thanks
Apr 07 2007
Sebastian wrote:hi, is possibile to compile .so for linux and for mac, with D? if true how i can do that? thanksUse GDC maybe? http://sourceforge.net/project/showfiles.php?group_id=154306 ~ Clay
Apr 08 2007
Sebastian <sebastian.faltoni gmail.com> spewed this unto the Network:hi, is possibile to compile .so for linux and for mac, with D? if true how i can do that? thanksThis isn't handled by a compiler, but the linker, ld. First, you get the D compiler to generate an .o file. The "-c" option accomplishes this in both the DMD and GDC compilers: gdc -c foo.d Then, the "ld" command line is as follows: ld -shared foo.o -o foo.so -- All your .signature are belong to us. Take off every 'sig' for great justice.
Apr 28 2007
nobody nowhere.nonet wrote:Sebastian <sebastian.faltoni gmail.com> spewed this unto the Network:Are you sure? Shouldn't the compiler generate position-independent code? (That's what I seem to remember and will assume for the rest of the code. It that's not true, please ignore the rest of this post :) )hi, is possibile to compile .so for linux and for mac, with D? if true how i can do that? thanksThis isn't handled by a compiler, but the linker, ld. First,you get the D compiler to generate an .o file. The "-c" option accomplishes this in both the DMD and GDC compilers: gdc -c foo.dThis generates relocatable code, not position-independent code. For that, you need to specify -fpic or -fPIC (for GDC, DMD can't do this IIRC).Then, the "ld" command line is as follows: ld -shared foo.o -o foo.soThis would be correct if foo.o contained position-independent code.
Apr 29 2007