gcc 9 vs. dmd?

Andrew Pennebaker andrew.pennebaker at gmail.com
Fri Nov 30 04:47:26 UTC 2018


On Friday, 30 November 2018 at 01:31:12 UTC, mawk wrote:
> On Friday, 30 November 2018 at 00:43:59 UTC, Andrew Pennebaker 
> wrote:
>> Given that gcc v9 should have built-in support for compiling D 
>> code, and that dmd requires gcc, will dmd continue to be 
>> supported? Or perhaps have its guts incorporated completely 
>> into gcc?
>
> DMD doesn't really require GCC, GCC is in theory used for 
> compatibility with modules compiled with gcc according to 
> dmd(1), and in practice used for linking.
>
> The linking step could be done with ld alone if you know what 
> to type, and it's honestly pretty complicated, and you still 
> need components from gcc, for various reasons:
>
> LIBGCCDIR=$(cc -print-file-name=)
> CRTDIR=/usr/lib/$(cc -dumpmachine)
>
> ld -L $LIBGCCDIR $CRTDIR/Scrt1.o $CRTDIR/crti.o 
> $LIBGCCDIR/crtbeginS.o \
> YOUROBJECT.o -E --push-state -static -lphobos2 --pop-state \
> -lpthread -lm -lrt -ldl -lc -lgcc -lgcc_s $LIBGCCDIR/crtendS.o 
> $CRTDIR/crtn.o

gcc is currently required for dmd on FreeBSD, as dmd links to 
libstdc++.


More information about the Digitalmars-d-learn mailing list