<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 28, 2016 at 1:27 PM, Matthias Braun <span dir="ltr"><<a href="mailto:matze@braunis.de" target="_blank">matze@braunis.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>That works, however AFAIK you better use this:</div><div><br></div><div><span class="gmail-"><div>    ld_cmd = subprocess.Popen([config.gold_executable, '-v'], stdout = subprocess.PIPE, stderr = subprocess.PIPE)</div></span><div>    ld_out, _ = ld_cmd.communicate()</div><div>    ld_out = ld_out.decode()</div></div><div><br></div><div>or you have a chance that the process deadlocks when the stderr buffer runs full while you wait for stdout output. (I've only seen this happening with kilobytes of output so it probably won't be an issue here, but I couldn't stop noticing...)</div></div></blockquote><div><br></div><div>Ok sounds good. Fixed in r277092.</div><div><br></div><div>Thanks,</div><div>Teresa</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>- Matthias</div></font></span><div><div class="gmail-h5"><br><div><blockquote type="cite"><div>On Jul 28, 2016, at 12:02 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>> wrote:</div><br class="gmail-m_1750969268125662609Apple-interchange-newline"><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 28, 2016 at 11:51 AM, Matthias Braun <span dir="ltr"><<a href="mailto:matze@braunis.de" target="_blank">matze@braunis.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">MatzeB added a subscriber: MatzeB.<br>
MatzeB added a comment.<br>
<br>
This leads to the output of "ld -v" getting shown on my terminal every time I run "ninja check-llvm" on my macOS system.<br>
(For some reason lit.site.cfg also has config.gold_executable pointing to /usr/bin/ld even though I am pretty sure that is not a gold linker on my machine).<br></blockquote><div><br></div><div>Sorry about that! I just checked on my Mac, and it looks like the output of ld -v goes to stderr not stdout. I think this will fix it, can you give it a try? I don't have an LLVM checkout/build on my Mac, it would take me some time to figure out how to get that set up.</div><div><br></div><div> diff --git a/test/tools/gold/X86/v1.12/lit.local.cfg b/test/tools/gold/X86/v1.12/lit.local.cfg</div><div>index 3ac6f01..2b0f58c 100644</div><div>--- a/test/tools/gold/X86/v1.12/lit.local.cfg</div><div>+++ b/test/tools/gold/X86/v1.12/lit.local.cfg</div><div>@@ -6,7 +6,7 @@ def is_gold_v1_12_linker_available():</div><div>   if not config.gold_executable:</div><div>     return False</div><div>   try:</div><div>-    ld_cmd = subprocess.Popen([config.gold_executable, '-v'], stdout = subprocess.PIPE)</div><div>+    ld_cmd = subprocess.Popen([config.gold_executable, '-v'], stdout = subprocess.PIPE, stderr = subprocess.PIPE)</div><div>     ld_out = ld_cmd.stdout.read().decode()</div><div>     ld_cmd.wait()</div><div>   except:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div class="gmail-m_1750969268125662609gmail-HOEnZb"><div class="gmail-m_1750969268125662609gmail-h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D22827" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22827</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail-m_1750969268125662609gmail_signature"><span style="font-family:times;font-size:inherit"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> <a href="tel:408-460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</div></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Teresa Johnson |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>