diff options
| -rw-r--r-- | lld/Common/Version.cpp | 7 | ||||
| -rw-r--r-- | lld/ELF/Driver.cpp | 2 | ||||
| -rw-r--r-- | lld/MinGW/Driver.cpp | 2 | ||||
| -rw-r--r-- | lld/test/ELF/version.test | 2 | ||||
| -rw-r--r-- | lld/test/MinGW/driver.test | 2 |
5 files changed, 10 insertions, 5 deletions
diff --git a/lld/Common/Version.cpp b/lld/Common/Version.cpp index ec6eda6..78f7c6b 100644 --- a/lld/Common/Version.cpp +++ b/lld/Common/Version.cpp @@ -11,8 +11,8 @@ //===----------------------------------------------------------------------===// #include "lld/Common/Version.h" - #include "VCSVersion.inc" +#include "llvm/Support/VCSRevision.h" // Returns a version string, e.g.: // LLD 14.0.0 (https://github.com/llvm/llvm-project.git @@ -23,6 +23,11 @@ std::string lld::getLLDVersion() { #else #define LLD_VENDOR_DISPLAY #endif +#if defined(LLVM_REPOSITORY) || defined(LLVM_REVISION) + return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING " (" LLVM_REPOSITORY + " " LLVM_REVISION ")"; +#else return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING; +#endif #undef LLD_VENDOR_DISPLAY } diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index a4863d6..7800c29 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -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 diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp index 35fd478..1fd120a 100644 --- a/lld/MinGW/Driver.cpp +++ b/lld/MinGW/Driver.cpp @@ -199,7 +199,7 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS, // a GNU compatible linker. As long as an output for the -v option // contains "GNU" or "with BFD", they recognize us as GNU-compatible. if (args.hasArg(OPT_v) || args.hasArg(OPT_version)) - message(getLLDVersion() + " (compatible with GNU linkers)"); + message(getLLDVersion() + ", compatible with GNU linkers"); // The behavior of -v or --version is a bit strange, but this is // needed for compatibility with GNU linkers. diff --git a/lld/test/ELF/version.test b/lld/test/ELF/version.test index cdeeb47..383c1ac 100644 --- a/lld/test/ELF/version.test +++ b/lld/test/ELF/version.test @@ -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 diff --git a/lld/test/MinGW/driver.test b/lld/test/MinGW/driver.test index b723c0a..44ec588 100644 --- a/lld/test/MinGW/driver.test +++ b/lld/test/MinGW/driver.test @@ -268,7 +268,7 @@ APPCONTAINER: -appcontainer RUN: ld.lld -m i386pep --version 2>&1 | FileCheck -check-prefix=VERSION %s RUN: ld.lld -m i386pep -v 2>&1 | FileCheck -check-prefix=VERSION %s RUN: not ld.lld -m i386pep -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s -VERSION: LLD {{.*}} (compatible with GNU linkers) +VERSION: LLD {{.*}}, compatible with GNU linkers RUN: ld.lld -m i386pep --help 2>&1 | FileCheck -check-prefix=HELP %s HELP: USAGE: |
