[PATCH] D102321: [llvm-nm] Support the -V option, print that the tool is compatible with GNU nm

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 10:28:50 PDT 2021


mstorsjo added a comment.

In D102321#2754456 <https://reviews.llvm.org/D102321#2754456>, @MaskRay wrote:

> llvm/docs/CommandGuide/llvm-nm.rst needs update.

Ok, will do



================
Comment at: llvm/test/tools/llvm-nm/libtool-version.test:3
+RUN: llvm-nm --version | FileCheck %s
+Check that the output of llvm-nm -V (and --version) contains the text
+"GNU" somewhere, to let libtool know that it is compatible with GNU nm.
----------------
MaskRay wrote:
> Move the file level comment above the commands.
Sure, will do


================
Comment at: llvm/tools/llvm-nm/llvm-nm.cpp:2241
+static void printExtraVersionInfo(raw_ostream &outs) {
+  outs << "llvm-nm, compatible with GNU nm\n";
+}
----------------
MaskRay wrote:
> MaskRay wrote:
> > Does libtool detect the substring `GNU nm`? If not, the notice should be dropped.
> > 
> > For example, `ld.lld` prints `compatible with GNU linkers` just because libtool detects `GNU` (D31199).
> If yes, there needs to be a comment.
Libtool detects ”GNU” only, but not necessarily “GNU nm”. Is this wording ok (while adding a comment explaining why) or do you want it written differently?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102321



More information about the llvm-commits mailing list