Skip to content

Commit 649cdfc

Browse files
authored
[ELF] Reinstate the former spelling in the version message
With `LLVM_APPEND_VC_REV=off`, the new version message after #97323 looks like: ``` % /tmp/out/custom2/bin/ld.lld --version LLD 19.0.0, compatible with GNU linkers ``` A trailing comma after the version string might cause issues with version detection tools that don't strip it, as seen in the Linux kernel's scripts/ld-version.sh script. Pull Request: #97942
1 parent 07c157a commit 649cdfc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lld/ELF/Driver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
631631
// of Libtool. We cannot convince every software developer to migrate to
632632
// the latest version and re-generate scripts. So we have this hack.
633633
if (args.hasArg(OPT_v) || args.hasArg(OPT_version))
634-
message(getLLDVersion() + ", compatible with GNU linkers");
634+
message(getLLDVersion() + " (compatible with GNU linkers)");
635635

636636
if (const char *path = getReproduceOption(args)) {
637637
// Note that --reproduce is a debug option so you can ignore it

lld/test/ELF/version.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# RUN: ld.lld -V 2>&1 | FileCheck %s
88
# RUN: not ld.lld -V %t/not-exist 2>&1 | FileCheck %s
99

10-
# CHECK: LLD {{.*}}, compatible with GNU linkers
10+
# CHECK: LLD {{.+}} (compatible with GNU linkers)

0 commit comments

Comments
 (0)