[lld] r217112 - If lld binary is named 'ld' on darwin, use darwin driver mode

Joerg Sonnenberger joerg at britannica.bec.de
Mon Sep 8 14:09:21 PDT 2014


On Mon, Sep 08, 2014 at 01:23:21PM -0700, Rui Ueyama wrote:
> On Mon, Sep 8, 2014 at 12:15 PM, Joerg Sonnenberger <joerg at britannica.bec.de
> > wrote:
> 
> > On Fri, Sep 05, 2014 at 06:41:26PM -0700, Nick Kledzik wrote:
> > > > I don't think it does that. parseProgramName gets called for the full
> > > > name in case of triple prefixing. Your change breaks using e.g.
> > > > x86_86-netbsd-ld as binary name, doesn't it?
> > >
> > > It would only be a problem if you built the lld binary on MacOSX,
> > > renamed it to "x86_86-netbsd-ld” than ran it and expected it to behave
> > > as a gnu linker.
> >
> > It's one way to use it for cross-compiling, so yes, I expect that.
> >
> > > If you think that is a valid configuration, I can move the #if __APPLE_
> > > check out of strToFlavor(), and instead inside UniversalDriver::link()
> > > do a check if argv[0] is exactly “ld” inside  #if __APPLE_ .
> >
> > If a triple is given, check if the OS is Darwin(ish). If not, checking
> > the default/host is fine.
> >
> 
> I don't see a strong reason to do that, as one can always use lld with
> -target option instead of renaming an executable file, but it wouldn't
> hurt. So if someone wants such behavior I don't object.

It integrates well with existing logic in clang, that's why.

Joerg



More information about the llvm-commits mailing list