<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/144732>144732</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[OCaml] Getting "duplicate libraries" warning from linker
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ColMcp
</td>
</tr>
</table>
<pre>
_Bindings version_: llvm.19-shared
_OCaml version_: 5.3
_OS_: macOS Sequoia 15.5 on M4 iMac
### Minor annoyance
Dune builds of an executable which references more than one of the libraries in the llvm package get a warning:
`ld: warning: ignoring duplicate libraries: '-lLLVM-19', '-lc++', '-lm', '-lz', '-lzstd'`. The executable runs OK.
I’ve looked at dune’s log file and at some tracing from the `ocamlopt.opt` command dune invokes to link my executable. From the latter I can see that for each library from the llvm bindings package that my executable references `ocamlopt.opt` emits a `-l` argument for the appropriate library plus five others: `-lLLVM-19 -lc++ -lm -lz -lzstd`. The macOS build tool (`clang`) generates the warning I see about these duplicate libraries.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsVMtu8zgPfRp5Q8Sw5UvihRe9_PlRzBd00cFsC1qmbU1lySPJ6eR7-oGUpEmBAgIMkhYv5xwRnZOjJmpZ9ciq5wRXPxnbPhl1EEvSmf7Uvj9K3Us9OjiSddLod1Y8gFLHOc2bjZvQUs-yh_fXJ5zVt3-qtIiBt2jNKF7f4I3-WY1EyKu0AqPhUII8oGDZQzi8OB84SG0soNbmhFoQyx6eV03QrVL1DswAqIH-JbF67BTB5yTFBJYGsqQFOZiNJfATajCawv9-IlCys2glOZD67FDHGRYUHzgSjOQB4ROtlnpkReynzlQfer95QY7aWKlH6NdFSYH-Lm-IM77dqF-__jps8obxLeNPZ5dg_DGem2u-N35_M5zvg11nKfw50f2odtUOXv9Iz4i9sP9xtstY0xwJlDEf1AN66FdNXxEHyowwSEWAOoadmQm8RRHmGKyZIxqszozAWZnFp2bxrM5AmHkOd0I-kPpoPsiBN6Ck_oD5dNdXCvtrHoXek4UXEKjBUeTBw2AsEIrpgtbpVjey0F1FdqUjXvpW4p7fH3qlWXoHGEIbFRxox3UmfS4dCuGyWLNYeePsBItaHQzySGD8RPZMYchwoRC-mIONmmGjfsOFnis3Z11HZYI3RgHjO1ZnQqEeWZ0x3sBImiz6gN1EVzHBSwQHO7P64Hf0k6TSpG-LvikaTKjNt1XG67wqeTK1235blWUnKl4Pw27gXV6UXd9UZVcWmcA-kS3PeJXV-S6vyqrk6bYYeNPlVb-r6qIcBlZmNKNUaXzMxo6JdG6lNi_LbcEThR0pFzcD55o-IUYZ52FR2DZc2nTr6FiZKem8u6Xx0qu4UuJOYNUz_J-8DzMzzn96N5x_oRJlEfRFNlmtaifvl8AK43vG96P009qlwsyM70O9y2ezWPM3Cc_4PnbpGN9fxji2_L8AAAD__-esmAs">