Skip to content

Commit

Permalink
[ELF] Reinstate the former spelling in the version message
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MaskRay committed Jul 7, 2024
1 parent 07c157a commit 649cdfc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lld/ELF/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
// of Libtool. We cannot convince every software developer to migrate to
// the latest version and re-generate scripts. So we have this hack.
if (args.hasArg(OPT_v) || args.hasArg(OPT_version))
message(getLLDVersion() + ", compatible with GNU linkers");
message(getLLDVersion() + " (compatible with GNU linkers)");

if (const char *path = getReproduceOption(args)) {
// Note that --reproduce is a debug option so you can ignore it
Expand Down
2 changes: 1 addition & 1 deletion lld/test/ELF/version.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# RUN: ld.lld -V 2>&1 | FileCheck %s
# RUN: not ld.lld -V %t/not-exist 2>&1 | FileCheck %s

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

0 comments on commit 649cdfc

Please sign in to comment.