r313082 - [Driver] MinGW: Remove custom linker detection

Rui Ueyama via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 16:15:21 PDT 2017


I'm perhaps not the only person who is wondering, so I'll update the
original thread instead of replying to this thread.

On Tue, Sep 12, 2017 at 4:07 PM, Martell Malone <martellmalone at gmail.com>
wrote:

> cc @rui this is why I reverted it.
>
> On Wed, Sep 13, 2017 at 12:00 AM, Martell Malone <martellmalone at gmail.com>
> wrote:
>
>> Hi Mike,
>>
>> I reverted this for now, I assume it has to do with the argument ordering.
>> Will try a change and re apply.
>>
>> Many Thanks,
>> Martell
>>
>> On Tue, Sep 12, 2017 at 11:57 PM, Martell Malone <martellmalone at gmail.com
>> > wrote:
>>
>>> Hi Mike,
>>>
>>> I actually posted this in the phab thread a few minutes ago.
>>>
>>> ```
>>> Tests for this pass locally but the build bots are complaining with
>>>
>>> // CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>>                  ^
>>> <stdin>:1:1: note: scanning from here
>>> clang version 6.0.0 (trunk 313082)
>>> ^
>>> <stdin>:5:51: note: possible intended match here
>>> clang-6.0: error: invalid linker name in argument '-fuse-ld=lld'
>>>
>>>
>>> Can someone enlighten me before I do a revert? :)
>>> ```
>>>
>>> Best,
>>> Martell
>>>
>>> On Tue, Sep 12, 2017 at 11:54 PM, Mike Edwards <mike at sqlby.me> wrote:
>>>
>>>> Hi,
>>>> Would you please have a look at:
>>>> http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-in
>>>> cremental/42380/
>>>>
>>>> it appears this commit is causing some tests to fail on our bots.  Any
>>>> assistance you may provide in getting the bots back green would be greatly
>>>> appreciated.
>>>>
>>>> Respectfully,
>>>> Mike Edwards
>>>>
>>>> On Tue, Sep 12, 2017 at 3:14 PM, Martell Malone via cfe-commits <
>>>> cfe-commits at lists.llvm.org> wrote:
>>>>
>>>>> Author: martell
>>>>> Date: Tue Sep 12 15:14:18 2017
>>>>> New Revision: 313082
>>>>>
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=313082&view=rev
>>>>> Log:
>>>>> [Driver] MinGW: Remove custom linker detection
>>>>>
>>>>> In rL289668 the ability to specify the default linker at compile time
>>>>> was added but because the MinGW driver used custom detection we could
>>>>> not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER.
>>>>>
>>>>> Modified:
>>>>>     cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
>>>>>     cfe/trunk/test/Driver/mingw-useld.c
>>>>>
>>>>> Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
>>>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Too
>>>>> lChains/MinGW.cpp?rev=313082&r1=313081&r2=313082&view=diff
>>>>> ============================================================
>>>>> ==================
>>>>> --- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)
>>>>> +++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Tue Sep 12 15:14:18 2017
>>>>> @@ -104,14 +104,6 @@ void tools::MinGW::Linker::ConstructJob(
>>>>>    // handled somewhere else.
>>>>>    Args.ClaimAllArgs(options::OPT_w);
>>>>>
>>>>> -  StringRef LinkerName = Args.getLastArgValue(options::OPT_fuse_ld_EQ,
>>>>> "ld");
>>>>> -  if (LinkerName.equals_lower("lld")) {
>>>>> -    CmdArgs.push_back("-flavor");
>>>>> -    CmdArgs.push_back("gnu");
>>>>> -  } else if (!LinkerName.equals_lower("ld")) {
>>>>> -    D.Diag(diag::err_drv_unsupported_linker) << LinkerName;
>>>>> -  }
>>>>> -
>>>>>    if (!D.SysRoot.empty())
>>>>>      CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
>>>>>
>>>>> @@ -241,7 +233,7 @@ void tools::MinGW::Linker::ConstructJob(
>>>>>
>>>>>        if (Args.hasArg(options::OPT_static))
>>>>>          CmdArgs.push_back("--end-group");
>>>>> -      else if (!LinkerName.equals_lower("lld"))
>>>>> +      else
>>>>>          AddLibGCC(Args, CmdArgs);
>>>>>      }
>>>>>
>>>>> @@ -252,7 +244,7 @@ void tools::MinGW::Linker::ConstructJob(
>>>>>        CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crtend
>>>>> .o")));
>>>>>      }
>>>>>    }
>>>>> -  const char *Exec = Args.MakeArgString(TC.GetProgr
>>>>> amPath(LinkerName.data()));
>>>>> +  const char *Exec = Args.MakeArgString(TC.GetLinkerPath());
>>>>>    C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs,
>>>>> Inputs));
>>>>>  }
>>>>>
>>>>>
>>>>> Modified: cfe/trunk/test/Driver/mingw-useld.c
>>>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mi
>>>>> ngw-useld.c?rev=313082&r1=313081&r2=313082&view=diff
>>>>> ============================================================
>>>>> ==================
>>>>> --- cfe/trunk/test/Driver/mingw-useld.c (original)
>>>>> +++ cfe/trunk/test/Driver/mingw-useld.c Tue Sep 12 15:14:18 2017
>>>>> @@ -1,19 +1,19 @@
>>>>> -// RUN: %clang -### -target i686-pc-windows-gnu
>>>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck
>>>>> -check-prefix=CHECK_LD_32 %s
>>>>> -// CHECK_LD_32: ld{{(.exe)?}}"
>>>>> +// RUN: %clang -### -target i686-pc-windows-gnu
>>>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=platform
>>>>> 2>&1 | FileCheck -check-prefix=CHECK_LD_32 %s
>>>>> +// CHECK_LD_32: "{{[^"]*}}ld{{(.exe)?}}"
>>>>>  // CHECK_LD_32: "i386pe"
>>>>> -// CHECK_LD_32-NOT: "-flavor" "gnu"
>>>>> +// CHECK_LD_32-NOT: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>>>>
>>>>>  // RUN: %clang -### -target i686-pc-windows-gnu
>>>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
>>>>> FileCheck -check-prefix=CHECK_LLD_32 %s
>>>>>  // CHECK_LLD_32-NOT: invalid linker name in argument
>>>>> -// CHECK_LLD_32: lld{{(.exe)?}}" "-flavor" "gnu"
>>>>> +// CHECK_LLD_32: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>>>>  // CHECK_LLD_32: "i386pe"
>>>>>
>>>>>  // RUN: %clang -### -target x86_64-pc-windows-gnu
>>>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
>>>>> FileCheck -check-prefix=CHECK_LLD_64 %s
>>>>>  // CHECK_LLD_64-NOT: invalid linker name in argument
>>>>> -// CHECK_LLD_64: lld{{(.exe)?}}" "-flavor" "gnu"
>>>>> +// CHECK_LLD_64: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>>>>  // CHECK_LLD_64: "i386pep"
>>>>>
>>>>>  // RUN: %clang -### -target arm-pc-windows-gnu
>>>>> --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 |
>>>>> FileCheck -check-prefix=CHECK_LLD_ARM %s
>>>>>  // CHECK_LLD_ARM-NOT: invalid linker name in argument
>>>>> -// CHECK_LLD_ARM: lld{{(.exe)?}}" "-flavor" "gnu"
>>>>> +// CHECK_LLD_ARM: "{{[^"]*}}ld.lld{{(.exe)?}}"
>>>>>  // CHECK_LLD_ARM: "thumb2pe"
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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/20170912/d9db783d/attachment.html>


More information about the cfe-commits mailing list