<div dir="ltr">On Sat, Nov 1, 2014 at 7:04 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So, I vaguely don't like this....<div><br></div><div>I'm pretty comfortable with 'clang -O3 x.o y.o z.o -o my_binary' passing O3 to the LTO plugin, but less comfortable with passing it to the linker itself. I'm not really sure why though, so I'm open to be convinced otherwise. I don't have any principled stance here, it just seems somewhat off.</div><div><br></div><div>I asked Rafael on IRC to check with GCC, and it requires "-Wl,-O3", and so my current vote is for us to not invent a new convenience thing here. I'd be interested if others disagree, and if so why.</div></div></blockquote><div><br></div><div>I also disagree with the patch, and don't think that we should be passing the optimization flag down to the linker if the compiler flag was provided.  If nothing else, it doesn't leave a way for me to disable it.  The -O flags are generally assumed to only effect compilation, not linking.  I know that the GNU linker does provide a few optimization options, but, passing that in via -Wl,-O1 explicitly feels like the right thing.  This would also allow you to select which optimizations you want applied.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 20, 2014 at 9:35 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is fairly common for -O to be passed to clang when linking and both<br>
bfd and gold support -O options, but currently the driver doesn't<br>
translate it and projects have to use -Wl,-O if they want to enable<br>
those options. In fact, our own build pass -O3, but not -Wl,-O.<br>
<br>
The attached patch translates and forwards the -O options to the linker.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>