<div class="gmail_quote">On Wed, Jul 27, 2011 at 11:46 PM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com">doob@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 2011-07-28 03:23, Andrew Wiley wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Wed, Jul 27, 2011 at 2:10 AM, Jacob Carlborg <<a href="mailto:doob@me.com" target="_blank">doob@me.com</a><br></div><div class="im">
<mailto:<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>>> wrote:<br>
<br>
        Cannot be implemented in GDC. The driver/compiler/assembler/__<u></u>linker<br>
        structure doesn't allow it.<br>
<br>
<br>
    Why is that?<br>
<br>
<br></div><div class="im">
Well, the short version is that GDC (the executable) is not a compiler.<br>
GDC is a driver that runs cc1d to compile your code, runs as (at least I<br>
think that's the name offhand) to assemble it, then runs ld to link it.<br>
As far as I know, there's no way for cc1d to communicate the contents of<br>
pragmas like this back to the driver, which it would have to do if you<br>
wanted the driver to include the library in the arguments to the linker.<br>
It's possible that I just don't know the infrastructure well enough, but<br>
I think this is one of the reasons the GCC guys refused to implement<br>
#pragma in C/C++ as well.<br>
</div></blockquote>
<br>
I don't really get this. GDC is a D front end for the GCC back end. So the the front end should handle all language specific things, like the pragma. Then I assume the front end can pass options to the linker. Is this not the case?</blockquote>

<div><br></div><div>In traditional terms, cc1d is a compiler, including both the frontend and the backend. It takes parameters and spits out assembly. That's it.</div><div>The GDC executable is the driver responsible for running cc1d to compile the source to assembly, as to assemble the object files, and ld to link it all into a binary. cc1d cannot pass options to the linker because it does not invoke the linker.</div>

</div><br>