There seems to be a problem when building libraries with indirect dependencies to object files. That is, when calc.ml depends on dep.c which in turn depends on add.o.
I get the following error:
/usr/bin/ld: lib/add.o: in function `add':
add.c:(.text+0x0): multiple definition of `add'; lib/libc_test_stubs.a(add.o):add.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
The issue is also discussed at discuss.ocaml.org.
Reproduction
Specifications
- Version of
dune: 3.16.0
- Version of
ocaml: 5.2.0
Additional information