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.
In the meantime, and for the purpose of reviewing the series,
consider the attached patch, which merely adds FreeBSD to the list
of platforms virpcimock should be compiled on, rather than getting
rid of such a list altogether, squashed in.
--
Andrea Bolognani / Red Hat / Virtualization