summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-12-26 21:01:02 +0000
committerpatrick <patrick@openbsd.org>2017-12-26 21:01:02 +0000
commitc38fa16ca74bfd7e0e7bf415b35ec7f83e77bf13 (patch)
tree8934e4baa1bc48a32acaa17c1a66a753c2496ce1
parentUpdate to compiler-rt 5.0.1. (diff)
downloadwireguard-openbsd-c38fa16ca74bfd7e0e7bf415b35ec7f83e77bf13.tar.xz
wireguard-openbsd-c38fa16ca74bfd7e0e7bf415b35ec7f83e77bf13.zip
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@
-rw-r--r--gnu/llvm/tools/lld/ELF/Driver.cpp7
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;