<div dir="ltr">The idea is that if you specify -mode=compile, then no link happens and the output is potentially many object files.  If there's only one object file, then we allow the user to specify the name of that output.  But if there's multiple, then it's hard to specify that with a single command line invocation.  The user could always write multiple run lines each with -mode=compile and an explicit output file.<div><br></div><div>When you link, there's always exactly one output file, the executable (we don't count the PDB or DWP here, since we don't need to yet.  Maybe in the future if we need this someday we can revisit).  So for -mode=compile or -mode=compile-and-link, this is never an issue, since we only ever have 1 output.</div><div><br></div><div>It only comes up when you're compiling but *not* linking, *and* you specify multiple inputs (and hence multiple outputs).  We could always just forbid multiple inputs entirely with -mode=compile and require the user to write multiple RUN lines, but it seems likely that all of the options will be the same across all invocations, so this would be a nice shortcut.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 3, 2018 at 3:59 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">If that's the case, you specify -mode="compile-and-link" and you can specify the output.  That will work fine.  The condition in the code only checks for -mode='compile'</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 3, 2018 at 3:38 PM Stella Stamenova <<a href="mailto:stilis@microsoft.com" target="_blank">stilis@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-5979430659229274335m_-4889207622371303841WordSection1">
<p class="MsoNormal">Are there no cases where you want all of the input files to be compiled into a single executable?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> <br>
<b>Sent:</b> Monday, December 3, 2018 3:36 PM<br>
<b>To:</b> <a href="mailto:reviews%2BD55230%2Bpublic%2B74273d963dffb59e@reviews.llvm.org" target="_blank">reviews+D55230+public+74273d963dffb59e@reviews.llvm.org</a><br>
<b>Cc:</b> <a href="mailto:pavel@labath.sk" target="_blank">pavel@labath.sk</a>; Stella Stamenova <<a href="mailto:stilis@microsoft.com" target="_blank">stilis@microsoft.com</a>>; <a href="mailto:aleksandr.urakov@jetbrains.com" target="_blank">aleksandr.urakov@jetbrains.com</a>; <a href="mailto:clayborg@gmail.com" target="_blank">clayborg@gmail.com</a>; <a href="mailto:mgorny@gentoo.org" target="_blank">mgorny@gentoo.org</a>; <a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>; <a href="mailto:llvm@inglorion.net" target="_blank">llvm@inglorion.net</a><br>
<b>Subject:</b> Re: [PATCH] D55230: [lit] Multiple build outputs and default target bitness<u></u><u></u></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-5979430659229274335m_-4889207622371303841WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">If you have -o and multiple input files, which output file are you specifying? It seems easier to just say that if multiple input files are present, the output file names are automatically calculated
<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">On Mon, Dec 3, 2018 at 2:48 PM Stella Stamenova via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">stella.stamenova added inline comments.<br>
<br>
<br>
================<br>
Comment at: lldb/lit/helper/build.py:664<br>
+    if args.output and args.mode == 'compile' and len(args.inputs) > 1:<br>
+        raise ValueError('Cannot specify -o with mode=compile and multiple source files.  Use --outdir instead.')<br>
+<br>
----------------<br>
Why not? It makes sense that the test might still need to know and/or specify the name of the binary that was produced. The script could require that both -o and --outdir are specified, but I think -o is still needed.<br>
<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD55230%2Fnew%2F&data=02%7C01%7CSTILIS%40microsoft.com%7C57cc715a799b4d10776808d659782f58%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636794770069355805&sdata=oXmfk6T8RDrVrk8dK5t2yI7RVHRlY%2BbpN%2Bxyn3%2FiRzc%3D&reserved=0" target="_blank">
https://reviews.llvm.org/D55230/new/</a><br>
<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD55230&data=02%7C01%7CSTILIS%40microsoft.com%7C57cc715a799b4d10776808d659782f58%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636794770069355805&sdata=DdzhV7z8w%2FFT%2FWNi9NdBx%2BRqb06TaYeGL0UO%2Bo8P42k%3D&reserved=0" target="_blank">https://reviews.llvm.org/D55230</a><br>
<br>
<br>
<u></u><u></u></p>
</blockquote>
</div>
</div></div></blockquote></div>
</blockquote></div>