[Lldb-commits] [PATCH] D55230: [lit] Multiple build outputs and default target bitness

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 3 16:15:47 PST 2018

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.

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

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.

On Mon, Dec 3, 2018 at 3:59 PM Zachary Turner <zturner at google.com> wrote:

> 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'
> On Mon, Dec 3, 2018 at 3:38 PM Stella Stamenova <stilis at microsoft.com>
> wrote:
>> Are there no cases where you want all of the input files to be compiled
>> into a single executable?
>> *From:* Zachary Turner <zturner at google.com>
>> *Sent:* Monday, December 3, 2018 3:36 PM
>> *To:* reviews+D55230+public+74273d963dffb59e at reviews.llvm.org
>> *Cc:* pavel at labath.sk; Stella Stamenova <stilis at microsoft.com>;
>> aleksandr.urakov at jetbrains.com; clayborg at gmail.com; mgorny at gentoo.org;
>> lldb-commits at lists.llvm.org; llvm at inglorion.net
>> *Subject:* Re: [PATCH] D55230: [lit] Multiple build outputs and default
>> target bitness
>> 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
>> On Mon, Dec 3, 2018 at 2:48 PM Stella Stamenova via Phabricator <
>> reviews at reviews.llvm.org> wrote:
>> stella.stamenova added inline comments.
>> ================
>> Comment at: lldb/lit/helper/build.py:664
>> +    if args.output and args.mode == 'compile' and len(args.inputs) > 1:
>> +        raise ValueError('Cannot specify -o with mode=compile and
>> multiple source files.  Use --outdir instead.')
>> +
>> ----------------
>> 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.
>>   https://reviews.llvm.org/D55230/new/
>> <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>
>> https://reviews.llvm.org/D55230
>> <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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181203/bc4fc3d7/attachment.html>

More information about the lldb-commits mailing list