summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-03-24 02:55:04 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-03-24 02:55:04 +0000
commitffe2f842ac2556d41b2b856e10c00daee4c81a84 (patch)
tree85a163a7d28b84fba179b95f9144b5dc067bc57f /gnu
parent85da9be236df0691c51d8825248ede04861d7074 (diff)
Add "(compatible with GNU linkers)" to the lld version output to avoid
problems with configure scripts generated with libtool.m4 that would otherwise have to be regenerated with a patched libtool. Among other things this fixes the build of Mesa on arm64 with lld. From lld svn revision 298532. ok kettenis@
Diffstat (limited to 'gnu')
-rw-r--r--gnu/llvm/tools/lld/ELF/Driver.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/gnu/llvm/tools/lld/ELF/Driver.cpp b/gnu/llvm/tools/lld/ELF/Driver.cpp
index 3cf88e3c1ca..99253313c35 100644
--- a/gnu/llvm/tools/lld/ELF/Driver.cpp
+++ b/gnu/llvm/tools/lld/ELF/Driver.cpp
@@ -281,11 +281,27 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr, bool CanExitEarly) {
return;
}
- // GNU linkers disagree here. Though both -version and -v are mentioned
- // in help to print the version information, GNU ld just normally exits,
- // while gold can continue linking. We are compatible with ld.bfd here.
+ // Handle -v or -version.
+ //
+ // A note about "compatible with GNU linkers" message: this is a hack for
+ // scripts generated by GNU Libtool 2.4.6 (released in February 2014 and
+ // still the newest version in March 2017) or earlier to recognize LLD as
+ // a GNU compatible linker. As long as an output for the -v option
+ // contains "GNU" or "with BFD", they recognize us as GNU-compatible.
+ //
+ // This is somewhat ugly hack, but in reality, we had no choice other
+ // than doing this. Considering the very long release cycle of Libtool,
+ // it is not easy to improve it to recognize LLD as a GNU compatible
+ // linker in a timely manner. Even if we can make it, there are still a
+ // lot of "configure" scripts out there that are generated by old version
+ // 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_version) || Args.hasArg(OPT_v))
- outs() << getLLDVersion() << "\n";
+ outs() << getLLDVersion() << " (compatible with GNU linkers)\n";
+
+ // 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.
if (Args.hasArg(OPT_version))
return;