<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/119179>119179</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang-CL] Should -Xlinker be allowed for Clang-CL?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-cl
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Maetveis
</td>
</tr>
</table>
<pre>
Recently while exposing more options to the Fortran `flang` driver, some options were accidentally exposed to `clang-cl` too. Among them is `-Xlinker` to pass an argument to the linker, allowing granular control over the linker command line.
There are potential users for this flag, for example CMake has expressed a desire to have something like this:
> MSVC cl doesn't support driving the linker, or at least didn't when all this was developed. EDIT: at least not with sufficient control of the linker command line.
(https://gitlab.kitware.com/cmake/cmake/-/issues/24243#note_1289518)
@HaohaiWen reports that since the accidental introduction to trunk they already use of the flag. Could you maybe explain how you use it?
In #118640, I'm looking to disable the accidentally exposed flags, but due to being potentially useful, and the fact that there are no known users I've left `-Xlinker` available to `clang-cl`.
Should we keep this flag exposed? If yes we should have a test that uses it through `clang-cl`, which we lack currently. @HaohaiWen maybe you'd be willing to add one, given you are interested in keeping it working :^).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VE2P6zYM_DXKhdjAlvN58GGb3aALdC99D21vBW0xthpZNPQRv_z7QrL3o1u8UxCDQw5nhkLvdWeJarH9RWyfVhhDz65-RQo30n7VsLrXv1NLNpg7TL02BPRjZK9tBwM7Ah6DZushMISe4MwuOLQgdsXFoO3ErgDl9I2ckCfwPHwgJnIE2LZakQ1ozH3uTCr1EruiTfiH1qQWgXkNjwPbLk0ZQPtU8fCX0fZKbq6AEb0HtICuiwPZ8MZpKZInQGN4StQ7hzYadNCyDY4N8I3cp2JoeRjQqvSX1iCKR1E8fu8zY0cwciAbNBqInpyHCyew9nAx2KVB6QP9wGE0BKdXvBL06NN-jnzaEEGR144SxR5vlJUJfa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