r253813 - Driver: Specifically tell the linker the target for mingw-w64

Martell Malone via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 08:15:21 PST 2015


>
> This changes the linker from old-gnu to gnu. Are you sure you want to
> that?

Originally I didn't actually mean to commit that. I had been working on
some stuff locally.
Pointing to the new one should be fine as neither work for COFF atm anyway
so no point in having it point to the old one.
I'll make lld more verbose about this when it receives this emulation
target.

> I don't think the new linker takes a -target option. In any
> case, it needs a test.

You are correct the new linker does not support -target. I reverted this in
rL253874.


On Mon, Nov 23, 2015 at 7:05 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> This changes the linker from old-gnu to gnu. Are you sure you want to
> that? I don't think the new linker takes a -target option. In any
> case, it needs a test.
>
> Cheers,
> Rafael
>
>
> On 22 November 2015 at 00:40, Martell Malone via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > Author: martell
> > Date: Sat Nov 21 23:40:06 2015
> > New Revision: 253813
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=253813&view=rev
> > Log:
> > Driver: Specifically tell the linker the target for mingw-w64
> >
> > Cross compiling from linux and OSX results in Error: Exec format.
> > This is because the linker is expecting ELF formated objects.
> > By passing the target we can explicitly tell the linker that
> > it should be linking COFF objects regardless of the host.
> >
> > Modified:
> >     cfe/trunk/lib/Driver/Tools.cpp
> >
> > Modified: cfe/trunk/lib/Driver/Tools.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=253813&r1=253812&r2=253813&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Driver/Tools.cpp (original)
> > +++ cfe/trunk/lib/Driver/Tools.cpp Sat Nov 21 23:40:06 2015
> > @@ -9478,7 +9478,14 @@ void MinGW::Linker::ConstructJob(Compila
> >    StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
> "ld");
> >    if (LinkerName.equals_lower("lld")) {
> >      CmdArgs.push_back("-flavor");
> > -    CmdArgs.push_back("old-gnu");
> > +    CmdArgs.push_back("gnu");
> > +    CmdArgs.push_back("-target");
> > +    if (TC.getArch() == llvm::Triple::x86)
> > +      CmdArgs.push_back("i686--windows-gnu");
> > +    if (TC.getArch() == llvm::Triple::x86_64)
> > +      CmdArgs.push_back("x86_64--windows-gnu");
> > +    if (TC.getArch() == llvm::Triple::arm)
> > +      CmdArgs.push_back("armv7--windows-gnu");
> >    } else if (!LinkerName.equals_lower("ld")) {
> >      D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
> >    }
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151123/c275ec17/attachment.html>


More information about the cfe-commits mailing list