r256216 - [WebAssembly] Remove the -target command-line flag from the ld commandline.

Dan Gohman via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 14:54:23 PST 2015


It appears the reason it was only caught on Windows was that only Windows
appends ".exe" to executable files. Your change to match lld with {{.*}}
appended fixes it. Thanks!

Dan


On Tue, Dec 22, 2015 at 2:34 PM, Nico Weber <thakis at chromium.org> wrote:

> This might have broken the test on Windows:
>
> Command 1 Stderr:
> C:\src\chrome\src\third_party\llvm\tools\clang\test\Driver\wasm-toolchain.c:3:13:
> error: expected string not found in in
> put
> // AS_LINK: lld" "-flavor" "ld" "[[temp]]" "-o" "a.out"
>             ^
> <stdin>:5:476: note: scanning from here
>  "C:/src/chrome/src/third_party/llvm-bootstrap/./bin/clang.EXE" "-cc1as"
> "-triple" "wasm32-unknown-unknown" "-filetype"
> "obj" "-main-file-name" "wasm-toolchain.c" "-target-cpu" "generic"
> "-dwarf-version=4" "-fdebug-compilation-dir" "C:\\src
> \\chrome\\src\\third_party\\llvm-bootstrap\\tools\\clang\\test\\Driver"
> "-dwarf-debug-producer" "clang version 3.8.0 (tr
> unk 256248)" "-mrelocation-model" "static" "-o"
> "C:\\Users\\thakis\\AppData\\Local\\Temp\\wasm-toolchain-f6ec86.o" "C:\\
>
> src\\chrome\\src\\third_party\\llvm\\tools\\clang\\test\\Driver\\wasm-toolchain.c"
>
>
>
>
>                                          ^
> <stdin>:5:476: note: with variable "temp" equal to
> "C:\\\\Users\\\\thakis\\\\AppData\\\\Local\\\\Temp\\\\wasm-toolchain-
> f6ec86.o"
>  "C:/src/chrome/src/third_party/llvm-bootstrap/./bin/clang.EXE" "-cc1as"
> "-triple" "wasm32-unknown-unknown" "-filetype"
> "obj" "-main-file-name" "wasm-toolchain.c" "-target-cpu" "generic"
> "-dwarf-version=4" "-fdebug-compilation-dir" "C:\\src
> \\chrome\\src\\third_party\\llvm-bootstrap\\tools\\clang\\test\\Driver"
> "-dwarf-debug-producer" "clang version 3.8.0 (tr
> unk 256248)" "-mrelocation-model" "static" "-o"
> "C:\\Users\\thakis\\AppData\\Local\\Temp\\wasm-toolchain-f6ec86.o" "C:\\
>
> src\\chrome\\src\\third_party\\llvm\\tools\\clang\\test\\Driver\\wasm-toolchain.c"
>
>
>
>
>                                          ^
> <stdin>:6:63: note: possible intended match here
>  "C:\\src\\chrome\\src\\third_party\\llvm-bootstrap\\bin\\lld.exe"
> "-flavor" "ld" "C:\\Users\\thakis\\AppData\\Local\\Te
> mp\\wasm-toolchain-f6ec86.o" "-o" "a.out"
>                                                               ^
>
> I think I fixed this in 256286, but I'm a bit surprised this wasn't caught
> by any LLVM bots. Can you check why this wasn't caught?
>
> On Mon, Dec 21, 2015 at 6:30 PM, Dan Gohman via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> Author: djg
>> Date: Mon Dec 21 17:30:41 2015
>> New Revision: 256216
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=256216&view=rev
>> Log:
>> [WebAssembly] Remove the -target command-line flag from the ld
>> commandline.
>>
>> This flag isn't needed, or permitted, with the "ld" flavor of lld.
>>
>> Also, add a basic ld commandline test.
>>
>> Added:
>>     cfe/trunk/test/Driver/wasm-toolchain.c
>> 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=256216&r1=256215&r2=256216&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> +++ cfe/trunk/lib/Driver/Tools.cpp Mon Dec 21 17:30:41 2015
>> @@ -6516,8 +6516,6 @@ void wasm::Linker::ConstructJob(Compilat
>>    ArgStringList CmdArgs;
>>    CmdArgs.push_back("-flavor");
>>    CmdArgs.push_back("ld");
>> -  CmdArgs.push_back("-target");
>> -
>> CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString()));
>>    AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
>>    CmdArgs.push_back("-o");
>>    CmdArgs.push_back(Output.getFilename());
>>
>> Added: cfe/trunk/test/Driver/wasm-toolchain.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.c?rev=256216&view=auto
>>
>> ==============================================================================
>> --- cfe/trunk/test/Driver/wasm-toolchain.c (added)
>> +++ cfe/trunk/test/Driver/wasm-toolchain.c Mon Dec 21 17:30:41 2015
>> @@ -0,0 +1,3 @@
>> +// RUN: %clang -### -target wasm32-unknown-unknown -x assembler %s 2>&1
>> | FileCheck -check-prefix=AS_LINK %s
>> +// AS_LINK: clang{{.*}}" "-cc1as" {{.*}} "-o" "[[temp:[^"]*]]"
>> +// AS_LINK: lld" "-flavor" "ld" "[[temp]]" "-o" "a.out"
>>
>>
>> _______________________________________________
>> 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/20151222/97b78ae4/attachment-0001.html>


More information about the cfe-commits mailing list