[PATCH] D33259: Don't defer to the GCC driver for linking arm-baremetal

Rui Ueyama via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 14:02:35 PDT 2017


ruiu added inline comments.


================
Comment at: lib/Driver/ToolChains/BareMetal.h:42
+
+  const char *getDefaultLinker() const override { return "ld.lld"; }
+
----------------
jroelofs wrote:
> compnerd wrote:
> > jroelofs wrote:
> > > compnerd wrote:
> > > > I think that this really should be `ld` still, as that is the canonical name for the linker.
> > > You mean `lld`?
> > > 
> > > ```
> > > $ lld
> > > lld is a generic driver.
> > > Invoke ld.lld (Unix), ld (macOS) or lld-link (Windows) instead.
> > > ```
> > > 
> > > Or are you saying: "make binutils ld the default, not llvm's lld"?
> > Im saying use the name "ld".  ld is a symlink on most linux distributions these days.  ld -> ld.gold, ld.bfd, ld.lld
> I don't think this makes sense. I don't care about "most linux distributions", but rather about putting together an LLVM baremetal distribution based as much as possible on LLVM components. If someone wants a different linker, they can use `-fuse-ld=` and/or `-B`.
> 
> Also, doesn't using a symlink named `ld` cause `lld` to behave like a mach-o linker? We really want the elf one here.
If you invoke lld as ld, it behaves as a Mach-O linker on macOS. On other OSes, it behaves as an ELF linker.


https://reviews.llvm.org/D33259





More information about the cfe-commits mailing list