<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="">FYI, doesn’t look good to me, cf what I described on the other thread.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 21, 2016, at 9:51 PM, Nico Weber <<a href="mailto:thakis@chromium.org" class="">thakis@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Lgtm, works for me. Seems like a good compromise.</p>
<div class="gmail_extra"><br class=""><div class="gmail_quote">On Nov 21, 2016 6:29 PM, "Reid Kleckner" <<a href="mailto:rnk@google.com" class="">rnk@google.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">rnk created this revision.<br class="">
rnk added reviewers: mehdi_amini, thakis.<br class="">
rnk added a subscriber: cfe-commits.<br class="">
<br class="">
Without -flto, it's unlikely that users will experience LLVM version<br class="">
skew. The system installation of libLTO should be able to handle any<br class="">
pre-compiled LLVM bitcode from static archives.<br class="">
<br class="">
<br class="">
<a href="https://reviews.llvm.org/D26944" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/<wbr class="">D26944</a><br class="">
<br class="">
Files:<br class="">
  lib/Driver/Tools.cpp<br class="">
  test/Driver/darwin-ld-lto.c<br class="">
<br class="">
<br class="">
Index: test/Driver/darwin-ld-lto.c<br class="">
==============================<wbr class="">==============================<wbr class="">=======<br class="">
--- test/Driver/darwin-ld-lto.c<br class="">
+++ test/Driver/darwin-ld-lto.c<br class="">
@@ -1,5 +1,3 @@<br class="">
-// REQUIRES: system-darwin<br class="">
-<br class="">
 // Check that ld gets "-lto_library" and warnings about libLTO.dylib path.<br class="">
<br class="">
 // RUN: mkdir -p %T/bin<br class="">
@@ -12,12 +10,20 @@<br class="">
 // LINK_LTOLIB_PATH: {{ld(.exe)?"}}<br class="">
 // LINK_LTOLIB_PATH: "-lto_library"<br class="">
<br class="">
-// RUN: %clang -target x86_64-apple-darwin10 -### %s \<br class="">
+// Only warn if -flto is on the command line.<br class="">
+//<br class="">
+// RUN: %clang -target x86_64-apple-darwin10 -### %s -flto \<br class="">
 // RUN:   -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log<br class="">
 // RUN: FileCheck -check-prefix=LINK_LTOLIB_<wbr class="">PATH_WRN %s -input-file %t.log<br class="">
 //<br class="">
 // LINK_LTOLIB_PATH_WRN: warning: libLTO.dylib relative to clang installed dir not found; using 'ld' default search path instead<br class="">
<br class="">
+// Don't warn if -flto isn't present of -Wno-liblto is present.<br class="">
+//<br class="">
+// RUN: %clang -target x86_64-apple-darwin10 -### %s \<br class="">
+// RUN:   -ccc-install-dir %S/dummytestdir -mlinker-version=133 2> %t.log<br class="">
+// RUN: FileCheck -check-prefix=LINK_LTOLIB_<wbr class="">PATH_NOWRN %s -input-file %t.log<br class="">
+//<br class="">
 // RUN: %clang -target x86_64-apple-darwin10 -### %s \<br class="">
 // RUN:   -ccc-install-dir %S/dummytestdir -mlinker-version=133 -Wno-liblto 2> %t.log<br class="">
 // RUN: FileCheck -check-prefix=LINK_LTOLIB_<wbr class="">PATH_NOWRN %s -input-file %t.log<br class="">
Index: lib/Driver/Tools.cpp<br class="">
==============================<wbr class="">==============================<wbr class="">=======<br class="">
--- lib/Driver/Tools.cpp<br class="">
+++ lib/Driver/Tools.cpp<br class="">
@@ -8232,7 +8232,9 @@<br class="">
     if (llvm::sys::fs::exists(<wbr class="">LibLTOPath)) {<br class="">
       CmdArgs.push_back("-lto_<wbr class="">library");<br class="">
       CmdArgs.push_back(C.getArgs().<wbr class="">MakeArgString(LibLTOPath));<br class="">
-    } else {<br class="">
+    } else if (D.isUsingLTO()) {<br class="">
+      // Warn if we're using LTO with the system version of libLTO. It might not<br class="">
+      // understand LLVM bitcode generated by our version of LLVM.<br class="">
       D.Diag(diag::warn_drv_lto_<wbr class="">libpath);<br class="">
     }<br class="">
   }<br class="">
<br class="">
<br class="">
</blockquote></div></div>
</div></blockquote></div><br class=""></div></body></html>