<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - When attempting to compile/link Windows target from a WSL bash instance the driver attempts to load windows linker"
href="https://bugs.llvm.org/show_bug.cgi?id=34291">34291</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>When attempting to compile/link Windows target from a WSL bash instance the driver attempts to load windows linker
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>5.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Driver
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rennieallen@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Invocation (simple single function c source file):
$ clang -target x86_64-pc-windows-msvc18.0.0 -fuse-ld=lld -o foo.exe foo.c
clang: warning: unable to find a Visual Studio installation; try running Clang
from a developer command prompt [-Wmsvc-not-found]
clang: error: unable to execute command: Executable "lld-link.exe" doesn't
exist!
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The missing Visual Studio installation can presumably be easily rectified, but
the concern is the "lld-link.exe doesn't exist" error.
My understanding (perhaps I am wrong) is that lld on Linux should be able to
link a Windows executable as of 5.0, and that if the driver is Linux hosted it
should invoke the Linux hosted lld even when a windows target is selected.
Version confirmation:
$ which clang
/usr/local/bin/clang
$ clang --version
clang version 5.0.0 (<a href="http://root.cern.ch/git/clang.git">http://root.cern.ch/git/clang.git</a>
1f8b137c7eb06ed8e321649ef7e3f3e7a96f361c) (<a href="http://root.cern.ch/git/llvm.git">http://root.cern.ch/git/llvm.git</a>
2a34248cb945d63ded5ee55128e68efd7e5b87c8)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>