On Mon, 2018-04-30 at 10:59 +0100, Daniel P. Berrangé wrote:
On Mon, Apr 30, 2018 at 11:47:33AM +0200, Andrea Bolognani wrote:
> Mocking canonicalize_file_name() causes a linking error:
>
> ../gnulib/lib/.libs/libgnu.a(canonicalize-lgpl.o): In function
`canonicalize_file_name':
> .../libvirt/gnulib/lib/canonicalize-lgpl.c:417: multiple definition of
`canonicalize_file_name'
> .libs/virpcimock.o:.../libvirt/tests/virpcimock.c:983: first defined here
>
> This is not a problem on Linux, where canonicalize_file_name() is
> provided by libc, but FreeBSD is using the gnulib implementation
> instead, leading to the issue above.
AFAIK, the only way is to not link virpcimock.la to gnulib.
If we're lucky all the functions it needs would be present in the libvirt.so
already, so might just need a few things added to the export list ?
That compiles fine, but fails at runtime with
$ ./tests/qemumemlocktest
Missing symbol 'canonicalize_file_name'
Abort trap (core dumped)
I've tried a different approach: getting rid of the problematic
function altogether. Patches are on the list.
--
Andrea Bolognani / Red Hat / Virtualization