[libvirt] [PATCH v3 7/9] tests: Build virpcimock on non-Linux

Daniel P. Berrangé berrange at redhat.com
Thu May 3 15:33:20 UTC 2018


On Thu, May 03, 2018 at 02:28:48PM +0200, Andrea Bolognani wrote:
> On Thu, 2018-05-03 at 12:54 +0200, Andrea Bolognani wrote:
> > There are only a couple issues preventing it from working on
> > other platform such as FreeBSD. Let's fix them.
> > 
> > With the mocking in place, qemumemlocktest and qemuxml2xmltest
> > can finally succeed on FreeBSD.
> 
> Too bad it also happens to break compilation on macOS
> 
>   duplicate symbol _rpl_lstat in:
>       .libs/virpcimock.o
>       ../gnulib/lib/.libs/libgnu.a(lstat.o)
>   duplicate symbol _rpl_open in:
>       .libs/virpcimock.o
>       ../gnulib/lib/.libs/libgnu.a(open.o)
>   duplicate symbol _rpl_stat in:
>       .libs/virpcimock.o
>       ../gnulib/lib/.libs/libgnu.a(stat.o)
>   ld: 3 duplicate symbols for architecture x86_64
>   clang: error: linker command failed with exit code 1 (use -v to see invocation)
>   make[2]: *** [virpcimock.la] Error 1
> 
> and on MinGW
> 
>   ../../tests/virpcimock.c: In function 'make_symlink':
>   ../../tests/virpcimock.c:203:9: error: implicit declaration of function 'symlink'; did you mean 'unlink'? [-Werror=implicit-function-declaration]
>        if (symlink(target, filepath) < 0)
>            ^~~~~~~
>            unlink
>   ../../tests/virpcimock.c:203:9: error: nested extern declaration of 'symlink' [-Werror=nested-externs]
>   ../../tests/virpcimock.c: In function 'pci_read_file':
>   ../../tests/virpcimock.c:228:5: error: implicit declaration of function 'bzero' [-Werror=implicit-function-declaration]
>        bzero(buf, buf_size);
>        ^~~~~
>   ../../tests/virpcimock.c:228:5: error: incompatible implicit declaration of built-in function 'bzero' [-Werror]
>   In file included from ../gnulib/lib/fcntl.h:58:0,
>                    from ../../tests/virpcimock.c:27:
>   ../../tests/virpcimock.c: At top level:
>   ../../tests/virpcimock.c:964:1: error: redefinition of 'rpl_stat'
>    stat(const char *path, struct stat *sb)
>    ^
>   ../../tests/virpcimock.c:924:1: note: previous definition of 'rpl_stat' was here
>    lstat(const char *path, struct stat *sb)
>    ^
>   cc1: all warnings being treated as errors
>   gmake[2]: *** [Makefile:5505: virpcimock.lo] Error 1
> 
> I'll look into solving the latter, but I have no intention of
> spending time on the former because I don't have access to macOS
> machines and debugging this kind of failure through Travis would
> be just too painful and time consuming.

That's ok - FreeBSD testing is already giving us better confidence
in our macOS support as there's some overlapping heritage. 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list