[PATCH] D123173: [llvm-ml] Add support for the -o flag

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 13:32:34 PDT 2022


hans added a comment.

In D123173#3433751 <https://reviews.llvm.org/D123173#3433751>, @ayzhao wrote:

> In D123173#3433575 <https://reviews.llvm.org/D123173#3433575>, @hans wrote:
>
>> For clang-cl we support `-o` because MSVC supports it (although in the VS 2019 version I have it causes a warning saying it's deprecated). Does MSVC's ml.exe or ml64.exe support `-o`?
>
> `ml64.exe` doesn't support `-o`, but I think there's still some value in adding it to `llvm-ml`
>
> 1. It keeps command line flags consistent with other LLVM tools
> 2. When cross-compiling from *nix to Windows, having *nix-style flags can be beneficial as Windows style flags beginning with a forward slash look like file paths. I believe that this would make things less buggy.

I thought the purpose of llvm-ml was to act as a drop-in replacement of ml64.exe, in which case that's the command-line interface it should have. If we try make it support both ml64.exe's options and GNU as-inspired options at the same time, I worry we might en up with a bad interface.

Other llvm tools generally use a Unix-style interface, where the -o option is common, but this is not common for MSVC's tools. For clang-cl, we only added it because MSVC supports it and there was code that relied on it (see discussion in https://github.com/llvm/llvm-project/issues/21268). What's the use case for llvm-ml supporting -o?

As for using the forward slashes in cross-compiles from Unix to Windows, ml64.exe (like the other MSVC tools) also accept the flags with dashes, i.e. -Fo should work.

I guess the summary is that unless there's a compelling use case that needs llvm-ml to support -o, we should stick to the flags that ml64.exe uses.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123173/new/

https://reviews.llvm.org/D123173



More information about the llvm-commits mailing list