<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62634>62634</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            CMAKE: linker detection failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          carlo-bramini
      </td>
    </tr>
</table>

<pre>
    I tried to build the sources with CMake according to this guide:

https://llvm.org/docs/GettingStarted.html

When configuring, the process failed to detect the linker, by printing this message:
```
-- Linker detection: unknown
```
If you look into the code of AddLLVM.cmake, you will see this:
https://github.com/llvm/llvm-project/blob/48bbc64a8ff5e3777a76a02cffd94b3786b93203/llvm/cmake/modules/AddLLVM.cmake#L240
so, the GNU ld is detected by checking the reply of `-Wl,-v` option.
However, on my PC the tools reply with strings translated in my native language, so the command prints the italian text `"ld di GNU"` instead of `"GNU ld"`.
I fixed the trouble by setting an environment variable like this:
```
export LANG=en
```
for forcing the text to be output in english.
After that, the CMake correctly prints:
```
-- Linker detection: GNU ld
```
Probably, this is the best way for fixing this issue.
However, I have not found any reference into the guide linked on top of this post.
I would like to suggest to add this information into that guide, to be useful for other users.

Same behaviour on Windows CYGWIN and Linux Debian.
Tested with the latest developent sources at the time of writing (9fca0313f8c34ca9b4b5c434d4d013e86f47537a).
Both platforms have Binutils-2.40.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlc-O2zYQxp9GvgxsyKT87-DDZrfeLuoEAdJ20SNFjiTWFMcgR_b67QtScpJuk0MBw4Ylcvibb74Zqhht6xH3xepDsXqaqYE7CnutgqN5HVRvvZ3VZG77F-Bg0QAT1IN1BrhDiDQEjRGuljt4_KhOCEprCsb6Nq3kzkZoB2uwkA9F-VSU03fHfI7pmTgU4uDcpV9QaAtxMKRjIQ7PyGx9-4VVYDSLjnv3_fbXDj1o8o1th2B9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