<p>On Jul 11, 2013 1:28 AM, "H. S. Teoh" <<a href="mailto:hsteoh@quickfur.ath.cx">hsteoh@quickfur.ath.cx</a>> wrote:<br>
><br>
> On Tue, Jul 09, 2013 at 05:07:59PM -0700, H. S. Teoh wrote:<br>
> [...]<br>
> > I forked GDMD on github and took a first stab at D-ifying it:<br>
> ><br>
> >       <a href="https://github.com/quickfur/GDMD/tree/dport">https://github.com/quickfur/GDMD/tree/dport</a><br>
> [...]<br>
><br>
> Update:<br>
> - Fixed the path issues raised earlier (thanks for all the feedback!)<br>
><br>
> - I've added a whole bunch more code now, and a good number of dmd<br>
>   options are now understood. Most of the common ones are now supported,<br>
>   like -c, -inline, -O, and a few others. There's still a lot left to<br>
>   do, though. It never truly dawned on me before just how many options<br>
>   dmd has!  (Fortunately it's nowhere near the sheer number in gcc/gdc.<br>
>   ;-))<br>
><br>
> - Unittests were added!! Now I can feel less shameful. :-P<br>
><br>
> - Now gdmd can handle -of, -od, and -op. However, dmd appears to be<br>
>   extremely quirky in this area (esp. when these options are used<br>
>   together). Apparently, if the argument to -of contains '/', it<br>
>   implicitly sets -od as well. Gdmd still doesn't quite match dmd in<br>
>   this area.  One particularly problematic case is:<br>
><br>
>   Given this directory structure:<br>
>         ./src<br>
>         ./src/test.d<br>
><br>
>   Running dmd -ofbin/prog produces:<br>
>         ./bin<br>
>         ./bin/prog<br>
>         ./prog.o        <-- problem<br>
><br>
>   The trouble with this case is that currently gdmd always compiles each<br>
>   source file separately (following the behaviour of the old Perl</p>
<p>Are you sure on that?  :-)</p>
<p>My memory might be bad in this respect, but I seem to recall the script explicitly set the output program / object file name. (See below for why that matters ).</p>
<p>>   script), so we can't just rename the default test.o to prog.o. Also,<br>
>   IME, running gdc with too many .d files at once can sometimes cause<br>
>   memory problems, so doing it one at a time seems preferable.<br>
></p>
<p>Running dmd with too many .d files causes the same memory problems, but they tend to be short lived due to the speed of the compilation.<br></p>
<p>The difference between single and multiple file compilation is very subtle in gdc since the switch to LTO. </p>
<p>gdc foo.d bar.d.   # compiled separately.<br>
gdc foo.d bar.d -o exe   # compiled together.</p>
<p>People from a dmd background I found expected the latter, and separate compilation also comes with its own quirks that don't occur during single compilation of all sources (the most common suggested work around for this being -femit-templates, though should give the switch -fonly some lovin' someday).</p>

<p>Regards<br>
-- <br>
Iain Buclaw</p>
<p>*(p < e ? p++ : p) = (c & 0x0f) + '0';<br>
</p>