<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 4, 2015, at 11:03 AM, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Sep 4, 2015 at 12:48 AM Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class="">On Sep 4, 2015, at 12:22 AM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Sep 3, 2015 at 11:45 PM Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br class=""><br class="">> On Sep 2, 2015, at 7:31 PM, Peter Collingbourne via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">><br class="">> On Thu, Sep 03, 2015 at 01:10:42AM +0000, Eric Christopher wrote:<br class="">>> On Tue, Sep 1, 2015 at 10:43 AM Duncan P. N. Exon Smith <<br class="">>><span class=""> </span><a href="mailto:dexonsmith@apple.com" target="_blank" class="">dexonsmith@apple.com</a>> wrote:<br class="">>><br class="">>>><br class="">>>>> On 2015-Aug-31, at 18:09, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>> wrote:<br class="">>>>><br class="">>>>><br class="">>>>><br class="">>>>> On Mon, Aug 31, 2015 at 5:50 PM Duncan P. N. Exon Smith <<br class="">>>><span class=""> </span><a href="mailto:dexonsmith@apple.com" target="_blank" class="">dexonsmith@apple.com</a>> wrote:<br class="">>>>><br class="">>>>>> On 2015-Aug-31, at 12:21, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>> wrote:<br class="">>>>>> Yep. This is where I was going :)<br class="">>>>><br class="">>>>> Glad I found consensus, but I want to double-check that this makes<br class="">>>>> sense to add to the driver.  I didn't quite think through the<br class="">>>>> implications myself.<br class="">>>>><br class="">>>>> Since the driver doesn't know if there's any bitcode, or if LTO is<br class="">>>>> going to be invoked, it seems like I'll have to change the noasserts<br class="">>>>> driver to *always* pass the option to the linker just in case we are<br class="">>>>> doing LTO.  Is this reasonable?<br class="">>>>><br class="">>>>> Also, I realized that passing `-mllvm -disable-llvm-verifier` to ld64<br class="">>>>> is redundant... so I'm thinking `-mllvm -disable-verify`.  Make<br class="">>>>> sense?<br class="">>>>><br class="">>>>> *sigh* Reasons to hate the driver interface again...<br class="">>>>><br class="">>>>> I guess this is ok. Could possibly add it to the existing terrible<br class="">>>> "enable this pass" interface on liblto as well.<br class="">>>><br class="">>>> The linker doesn't know whether clang was built with asserts, though.<br class="">>>><br class="">>>> We could just make it implicit: move the decision to libLTO itself.  Given<br class="">>>> that clang and libLTO.dylib are different executables anyway -- and you<br class="">>>> might be interposing an asserts libLTO.dylib to use with an installed clang<br class="">>>> -- maybe it's even better?<br class="">>>><br class="">>>><br class="">>> *nod* We could do that. Seems better than the alternative.<br class="">><br class="">> +1<br class="">><br class="">>>>> I don't suppose ld64 could move to a model like we're talking about with<br class="">>>> lld that pcc is working on?<br class="">>>><br class="">>>> What specifically?<br class="">>><br class="">>><br class="">>> Ah, using the C++ interface to handle everything and not using libLTO at<br class="">>> all.<br class="">>><br class="">>> He can speak more to this though.<br class="">><br class="">> The C++ interface is much more convenient for a C++ program to use, but<br class="">> clients need to revlock themselves to LLVM in order to use it.<br class="">><br class="">> In theory the same does not apply to libLTO, but we do end up changing it<br class="">> occasionally to add new APIs which ld64 promptly starts using, so it isn't<br class="">> clear how much ld64 gains by relying on libLTO,<br class=""><br class="">Backward/Forward compatibility?<br class="">Drop any version of clang/libLTO and still be able to use the system provided linker on any version of OS X?<br class="">Sounds like a valuable feature to me, which is what I believe was (is?) sought by the C API in general (but that’s another story).<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">Static linking against the parts of llvm you care about? There's nothing in the ld64 build system that means it can't do this :)</div></div></div></div></blockquote><div class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class="">I’m not sure how is that supposed to work?</div><div class="">I drop a new clang/libLTO on the system, clang generates bitcode, and libLTO handles it.</div><div class=""><br class=""></div><div class="">If ld64 was statically linked against LLVM, it couldn’t read the new bitcode right?</div><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">Well sure, that's what Peter meant when he said revlocked. :)</div></div></div></div></blockquote><div><br class=""></div></div>I’m not sure we’re talking about the same thing, I may have misunderstood his point (“In theory the same does not apply to libLTO, but we do end up changing it<br class="">occasionally to add new APIs which ld64 promptly starts using, so it isn’t clear how much ld64 gains by relying on libLTO”) ; my take from that was that since the new ld64 starts using the new libLTO interface, there is a revlock anyway and then there is no advantage in keeping the old libLTO entry points.<div class="">I just described a use case that shows how useful it can be.</div><div class=""><br class=""></div><div class="">Apologize if I misunderstood the point.</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>