<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77198>77198</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm-config returns wrong library for libLTO
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
amyspark
</td>
</tr>
</table>
<pre>
Hey all,
I was trying to find an alternative to use the LTO library with Meson after I ran into a bug with Meson: mesonbuild/meson#12706.
However, the other alternative (using `llvm-config`) returns the wrong flags for this component:
```
dragonfire on main [✘!?] is 📦 v0.1.0 took 5s
❯ /usr/local/opt/llvm/bin/llvm-config --libs lto
-lLLVM-17
```
That should read instead `-lLTO`, since as explained [in its manual page](https://llvm.org/docs/LinkTimeOptimization.html#liblto), this library is supposed to be usable standalone. I've verified that's the case both in Windows, using the Microsoft and MSYS2 supplied versions, and in macOS using the Homebrew build, when replacing `-lLLVM-17` with `-lLTO`.
This was tested with LLVM 17.0.3 on Windows and LLVM 17.0.6 on macOS (Homebrew).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVM9uvDYQfprZy2gRmAWWA4dt8kOJtFEOiVr1aGCAaYyNbLPb9Okrw6bZSJWQYZh_38x8Y-kcD5qoguw3yB53cvGjsZWcPt0s7ceuMd1n9USfKJUC8QDxI8Sn7XzGq3To7SfrAb3BnnWHUqNUnqyWni8Ufi-O0I-E5_dXVNxYaT_xyn7EF3JGo-w9WXxGKzWy9gYlNstwZwHpCafw0SysOhD1KoBIE1HEeXSP6Mlc6UIWxMOa0fiR7A84II6LC3Ahj5W6TPvW6J4HyGMQJVryi9Vu9b1aowfslRwc9saiH9lha6bZaNIe0tN93uC_PavYWTmEuJbQaIRfv-Ao4BTjJFlj6PMvAeUDlEcQCaQ1ZI_IDqGOoayhTOGU4yWOkihGb8wHZg5vaYLfI5xqBFEvzoKolWmlAlGb2QdJXSYQd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