Hi Georgios,<div><br></div><div>Before we developed our own gcc backend, what I was usually doing -to try the compilation step- is to substitute the .o object generated by my own objects (compiled using the other compiler) and then remake, as the resulting object has a greater timestamp it will only link, but using my objects.</div>
<div><br></div><div>The problem that I see is when compiling with a different compiler is all the GNU extensions that are added to struct definitions, functions, etc... that could be probably included (like __attribute__ (...), these are not portable). But if your program is not using many barrelfish structs or functions, you can probably skip these header files.</div>
<div><br></div><div>Good luck!</div><div>zeus.</div><div><br></div><div><br><br><div class="gmail_quote">2011/8/26 Timothy Roscoe <span dir="ltr">&lt;<a href="mailto:troscoe@inf.ethz.ch">troscoe@inf.ethz.ch</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Georgios,<br>
<br>
Actually, source-to-source translators are much easier, since you can<br>
write rules to do the translation and which implicitly add the generated<br>
files to the list of C files to compile as normal.  What&#39;s a little more<br>
tricky is a different C -&gt; object file translation step.<br>
<br>
It&#39;s good that it&#39;s not urgent, and we should probably add custom C<br>
compilers to the wishlist next time we fiddle with Hake a bit more.<br>
<br>
  -- Mothy<br>
<div><div></div><div class="h5"><br>
On 08/26/2011 11:22 AM, Georgios Varisteas wrote:<br>
&gt; Hi Mothy,<br>
&gt;<br>
&gt; My usage for this feature is twofold. First, I require to have custom<br>
&gt; source-to-source compilers (as front-ends) for the various task-based<br>
&gt; programming models I&#39;m working with (i.e. Cilk, Wool). Moreover, I<br>
&gt; plan to try out Continuation-passing-style (like Cilk does) for my<br>
&gt; own runtime, which requires a custom code-generator to not use the<br>
&gt; stack. The purpose for CPS is to allow task-migration between threads<br>
&gt; of different cores.<br>
&gt;<br>
&gt; This feature is not urgent since I&#39;m only now starting the<br>
&gt; implementation, but it&#39;s good to know that it&#39;s doable. Since almost<br>
&gt; all of my research requires it though, I think I&#39;ll select the first<br>
&gt; and proper solution.<br>
&gt;<br>
&gt;<br>
&gt; -Georgios<br>
&gt;<br>
&gt; ________________________________________ From: Timothy Roscoe<br>
&gt; [<a href="mailto:troscoe@inf.ethz.ch">troscoe@inf.ethz.ch</a>] Sent: Friday, August 26, 2011 11:07 To:<br>
&gt; <a href="mailto:barrelfish-users@lists.inf.ethz.ch">barrelfish-users@lists.inf.ethz.ch</a> Subject: Re: [Barrelfish-users] CC<br>
&gt; variable<br>
&gt;<br>
&gt; Hi Georgios,<br>
&gt;<br>
&gt; We made an early decision to bury the binding of the C compiler<br>
&gt; fairly deep down in Hake&#39;s architecture abstractions.  If there<br>
&gt; really is a pressing need to specify the C compiler differently for<br>
&gt; different modules in the same build architecture, we would need to<br>
&gt; add the compiler name to the (ever-expanding) Opts record.  This is<br>
&gt; doable, but it&#39;s a bit of work.<br>
&gt;<br>
&gt; One alternative is to explicitly compile the C files by writing<br>
&gt; low-level Hake combinators in your Hakefile.  Hake won&#39;t compile (or<br>
&gt; calculate dependencies for) any C files which you don&#39;t explicitly<br>
&gt; hand it, so you can treat any C file specially if you&#39;re prepared to<br>
&gt; forego the convenience of the &quot;build library&quot; or &quot;build application&quot;<br>
&gt; functions. This might be the easiest way forward for a small module<br>
&gt; (how big is it?).<br>
&gt;<br>
&gt; This does require a bit more understanding of how Hake works, but<br>
&gt; most of what you need should be in the Technical Note.<br>
&gt;<br>
&gt; Hope this helps a bit...<br>
&gt;<br>
&gt; -- Mothy<br>
&gt;<br>
&gt; On 08/26/2011 10:19 AM, Georgios Varisteas wrote:<br>
&gt;&gt; Hi Simon,<br>
&gt;&gt;<br>
&gt;&gt; Thanks for the quick reply. Setting the compiler in ./hake/<br>
&gt;&gt; anywhere would be &quot;too&quot; permanent. What I would prefer is to use a<br>
&gt;&gt; custom compiler just for one module. Ideally there would be a<br>
&gt;&gt; CC-equivalent option in the hakefile. Could I try and add such a<br>
&gt;&gt; feature in hake?<br>
&gt;&gt;<br>
&gt;&gt; I can always have the compiler to be a wrapper script that invokes<br>
&gt;&gt; the correct compiler according to arguments (default being gcc).<br>
&gt;&gt; But this is a hassle for portability since I wont be able to have a<br>
&gt;&gt; variable for default_compiler to be passed to the wrapper script.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; -Georgios<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ________________________________________ From: Simon Peter<br>
&gt;&gt; [<a href="mailto:speter@inf.ethz.ch">speter@inf.ethz.ch</a>] Sent: Friday, August 26, 2011 10:03 To:<br>
&gt;&gt; Georgios Varisteas Cc: <a href="mailto:barrelfish-users@lists.inf.ethz.ch">barrelfish-users@lists.inf.ethz.ch</a> Subject:<br>
&gt;&gt; Re: [Barrelfish-users] CC variable<br>
&gt;&gt;<br>
&gt;&gt; Hi Georgios,<br>
&gt;&gt;<br>
&gt;&gt; We don&#39;t really do this, but it&#39;s probably to set the compiler<br>
&gt;&gt; variable in hake/X86_64.hs (for example) to something else.<br>
&gt;&gt;<br>
&gt;&gt; Hope this helps, Simon<br>
&gt;&gt;<br>
&gt;&gt; On 26.08.2011 09:58, Georgios Varisteas wrote:<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; What&#39;s the best way to setup hake to use a different compiler for<br>
&gt;&gt;&gt; a specific module?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Best regards, Georgios Varisteas<br>
&gt;&gt;&gt; _______________________________________________ Barrelfish-users<br>
&gt;&gt;&gt; mailing list <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
&gt;&gt;&gt; <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________ Barrelfish-users<br>
&gt;&gt; mailing list <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
&gt;&gt; <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
&gt;<br>
&gt; _______________________________________________ Barrelfish-users<br>
&gt; mailing list <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
&gt; <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
&gt;<br>
&gt; _______________________________________________ Barrelfish-users<br>
&gt; mailing list <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
&gt; <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
<br>
_______________________________________________<br>
Barrelfish-users mailing list<br>
<a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
<a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Zeus Gómez Marmolejo<br>Barcelona Supercomputing Center<br>PhD student<br><a href="http://www.bsc.es" target="_blank">http://www.bsc.es</a><br><br>
<br>
</div>