Skip to content

Commit f1f047b

Browse files
author
git apple-llvm automerger
committed
Merge commit '7e4883f8881b' from llvm.org/main into next
2 parents b6aba26 + 7e4883f commit f1f047b

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

llvm/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ Changes to the LLVM tools
174174
* llvm-ar now allows specifying COFF archive format with ``--format`` argument
175175
and uses it by default for COFF targets.
176176

177+
* llvm-ranlib now supports ``-V`` as an alias for ``--version``.
178+
``-v`` (``--verbose`` in llvm-ar) has been removed.
179+
(`#87661 <https://github.com/llvm/llvm-project/pull/87661>`_)
180+
177181
* llvm-objcopy now supports ``--set-symbol-visibility`` and
178182
``--set-symbols-visibility`` options for ELF input to change the
179183
visibility of symbols.

llvm/test/tools/llvm-ranlib/help-message.test

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
# RUN: llvm-ranlib -help | FileCheck %s --check-prefix=HELP
66
# RUN: llvm-ranlib --help | FileCheck %s --check-prefix=HELP
77
# RUN: llvm-ranlib --version | FileCheck %s --check-prefix=VERSION
8-
# RUN: llvm-ranlib -version | FileCheck %s --check-prefix=VERSION
9-
# RUN: llvm-ranlib -v | FileCheck %s --check-prefix=VERSION
8+
# RUN: llvm-ranlib -V | FileCheck %s --check-prefix=VERSION
109

1110
## Also check combined options (first -h/-v flag wins)
1211
# RUN: llvm-ranlib -Dh | FileCheck %s --check-prefix=HELP
13-
# RUN: llvm-ranlib -Dvh | FileCheck %s --check-prefix=VERSION
14-
# RUN: llvm-ranlib -Dhv | FileCheck %s --check-prefix=HELP
12+
# RUN: llvm-ranlib -DVh | FileCheck %s --check-prefix=VERSION
13+
# RUN: llvm-ranlib -DhV | FileCheck %s --check-prefix=HELP
1514

1615
# HELP: USAGE: llvm-ranlib
1716
# VERSION: version
17+
18+
## -v enables verbose output in BSD ranlib and GNU ar but is another alias
19+
## for --version in GNU ranlib. Reject -v.
20+
# RUN: not llvm-ranlib -v 2>&1 | FileCheck %s --check-prefix=ERR1
21+
# RUN: not llvm-ranlib -version 2>&1 | FileCheck %s --check-prefix=ERR2
22+
# RUN: not llvm-ranlib -Dvh 2>&1 | FileCheck %s --check-prefix=ERR3
23+
24+
# ERR1: error: Invalid option: '-v'
25+
# ERR2: error: Invalid option: '-version'
26+
# ERR3: error: Invalid option: '-vh'

llvm/tools/llvm-ar/llvm-ar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void printRanLibHelp(StringRef ToolName) {
6565
<< "USAGE: " + ToolName + " archive...\n\n"
6666
<< "OPTIONS:\n"
6767
<< " -h --help - Display available options\n"
68-
<< " -v --version - Display the version of this program\n"
68+
<< " -V --version - Display the version of this program\n"
6969
<< " -D - Use zero for timestamps and uids/gids "
7070
"(default)\n"
7171
<< " -U - Use actual timestamps and uids/gids\n"
@@ -1439,7 +1439,7 @@ static int ranlib_main(int argc, char **argv) {
14391439
} else if (arg.front() == 'h') {
14401440
printHelpMessage();
14411441
return 0;
1442-
} else if (arg.front() == 'v') {
1442+
} else if (arg.front() == 'V') {
14431443
cl::PrintVersionMessage();
14441444
return 0;
14451445
} else if (arg.front() == 'X') {

0 commit comments

Comments
 (0)