diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-12-26 21:01:03 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-12-26 21:01:03 +0000 |
commit | 347b1c77f52dd180aa729d8a5632c64418c87fd7 (patch) | |
tree | ae766bc3af61d13f873b6c71a40cbe3c541666f2 /gnu/llvm/tools/lld | |
parent | d8478f94377c30b0c1fd017df878b0a40e2c6d45 (diff) |
Cherry-pick a change from LLD to make the behavior of the -v option
more closer to GNU linkers. This should help with autoconf/libtool
compatibility in ports.
Requested by Brad
"no objection" kettenis@
Diffstat (limited to 'gnu/llvm/tools/lld')
-rw-r--r-- | gnu/llvm/tools/lld/ELF/Driver.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gnu/llvm/tools/lld/ELF/Driver.cpp b/gnu/llvm/tools/lld/ELF/Driver.cpp index a069bd637e7..ddc101e7298 100644 --- a/gnu/llvm/tools/lld/ELF/Driver.cpp +++ b/gnu/llvm/tools/lld/ELF/Driver.cpp @@ -345,9 +345,10 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr, bool CanExitEarly) { if (Args.hasArg(OPT_v) || Args.hasArg(OPT_version)) message(getLLDVersion() + " (compatible with GNU linkers)"); - // ld.bfd always exits after printing out the version string. - // ld.gold proceeds if a given option is -v. Because gold's behavior - // is more permissive than ld.bfd, we chose what gold does here. + // The behavior of -v or --version is a bit strange, but this is + // needed for compatibility with GNU linkers. + if (Args.hasArg(OPT_v) && !Args.hasArg(OPT_INPUT)) + return; if (Args.hasArg(OPT_version)) return; |