<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112836>112836</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`wasm-ld -v` exits without generating output
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jmillikin
</td>
</tr>
</table>
<pre>
lld has two version-related options, `-v` and `--version`. The difference is that `ld.lld -v -o hello hello.o` will print out its version and then continue, whereas `ld.lld --version -o hello hello.o` will exit immediately.
https://github.com/llvm/llvm-project/blob/7ba7d8e2f7b6445b60679da826210cdde29eaf8b/lld/ELF/Driver.cpp#L634-L635
https://github.com/llvm/llvm-project/blob/7ba7d8e2f7b6445b60679da826210cdde29eaf8b/lld/ELF/Driver.cpp#L657-L662
When lld is invokved as `wasm-ld` , it treats both flags identically and always exits early:
https://github.com/llvm/llvm-project/blob/7ba7d8e2f7b6445b60679da826210cdde29eaf8b/lld/wasm/Driver.cpp#L1193-L1197
This breaks existing tooling that expects `clang -Wl,-v` to generate output regardless of the chosen target platform.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMlD9vtDgQxj-NaUYgMCx_Cor33txWW0ZKPeABnHhtZA9s9tufzG6USKcrrrprxkJYzzz-PWNjCHq2RL04_SFOLwluvDjfv1-1MfpD22Rw6t4bo2DBAHxzsJMP2tnUk0EmBW5l7WwQ8jeIOk93UeeAVh0f6XOzqPMMXhcCpaeJPNmRQAfgBTnuMyqLHdIdUgcLGfOsmYtiN20MrF5bBrcxaA5fHo4-vJCF0VnWdqPo4raQJww_hb98_LM-fWoGfb2S0shk7pnIX0T-61EX5jWI8peQZyHPs-ZlG7LRXYU8G7N_Lenq3TuNLOR5MG4Q8twM2KiW5NQMdVWdhjqvm05hK2tZ5KNSJDvCqR0OASXk-c9LbPDi9U4-G9dVyPJSl1V6qcvT_8fQqUkvdS1_GnqLIUTUOoC2u_vYScEjgxuGa2pUJB3T0QzsCTnA4HiByeAcQCuyrEc05n5kiuaG93CEEoDQm3s87H8BILr_G4Gi6Mo01uanp9dFBxg84cfhPLC2M7Bz5ljjqNPnSiMfVEaDdob0zQj5-3Fn2MFMljwyxTlfNwZPM3plKARwUxx0GBcXyAKjn4lhNciT89csUX2purLDhPqikZ2UdVl0ydITDk2nuo4UTU1bFQrzeqjGAksqplYOie5lLqsiL9q8Ktuyy0jmTTsWJzx1bY1dI6qcrqhNFoFmzs-JDmGjvihkW9aJwYFMOF4PKS3d4PgrpIyPie-PFIZtDqLKjQ4cvmVYs6H-e0DggeGR-U3zEi_7k0gk-GCSbN70_zr9w1QQ8vx0vffyrwAAAP__MWKW4A">