<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">That works, however AFAIK you better use this:</div><div class=""><br class=""></div><div class=""><div class="">    ld_cmd = subprocess.Popen([config.gold_executable, '-v'], stdout = subprocess.PIPE, stderr = subprocess.PIPE)</div><div class="">    ld_out, _ = ld_cmd.communicate()</div><div class="">    ld_out = ld_out.decode()</div></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">- Matthias</div><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 28, 2016, at 12:02 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" class="">tejohnson@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jul 28, 2016 at 11:51 AM, Matthias Braun <span dir="ltr" class=""><<a href="mailto:matze@braunis.de" target="_blank" class="">matze@braunis.de</a>></span> wrote:<br class=""><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 class="">
MatzeB added a comment.<br class="">
<br class="">
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 class="">
(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 class=""></blockquote><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class=""> diff --git a/test/tools/gold/X86/v1.12/lit.local.cfg b/test/tools/gold/X86/v1.12/lit.local.cfg</div><div class="">index 3ac6f01..2b0f58c 100644</div><div class="">--- a/test/tools/gold/X86/v1.12/lit.local.cfg</div><div class="">+++ b/test/tools/gold/X86/v1.12/lit.local.cfg</div><div class="">@@ -6,7 +6,7 @@ def is_gold_v1_12_linker_available():</div><div class="">   if not config.gold_executable:</div><div class="">     return False</div><div class="">   try:</div><div class="">-    ld_cmd = subprocess.Popen([config.gold_executable, '-v'], stdout = subprocess.PIPE)</div><div class="">+    ld_cmd = subprocess.Popen([config.gold_executable, '-v'], stdout = subprocess.PIPE, stderr = subprocess.PIPE)</div><div class="">     ld_out = ld_cmd.stdout.read().decode()</div><div class="">     ld_cmd.wait()</div><div class="">   except:</div><div class=""><br class=""></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-HOEnZb"><div class="gmail-h5"><br class="">
<br class="">
Repository:<br class="">
  rL LLVM<br class="">
<br class="">
<a href="https://reviews.llvm.org/D22827" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D22827</a><br class="">
<br class="">
<br class="">
<br class="">
</div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><span style="font-family: times; font-size: inherit;" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small" class=""><td nowrap="" style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px" class=""> Software Engineer |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px" class=""> <a href="mailto:tejohnson@google.com" target="_blank" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px" class=""> 408-460-2413</td></tr></tbody></table></span></div>
</div></div>
</div></blockquote></div><br class=""></body></html>