moby/hyperkit

Compilation fails on MacOS 11.0

sab24 opened this issue · 5 comments

sab24 commented
src/lib/block_if.c:141:1: error: static declaration of 'preadv' follows non-static declaration
preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
^
In file included from src/lib/block_if.c:50:
In file included from src/include/xhyve/block_if.h:38:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/uio.h:103:9: note: previous declaration is here
ssize_t preadv(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(preadv) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
        ^
src/lib/block_if.c:152:1: error: static declaration of 'pwritev' follows non-static declaration
pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
^
In file included from src/lib/block_if.c:50:
In file included from src/include/xhyve/block_if.h:38:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/uio.h:104:9: note: previous declaration is here
ssize_t pwritev(int, const struct iovec *, int, off_t) __DARWIN_NOCANCEL(pwritev) __API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
        ^
2 errors generated.
make: *** [build/lib/block_if.o] Error 1
sab24 commented

Fixed by removing the static declaration part in the source code of hyperkit in src/lib/block_if.c lines 141 and 152. Unknown whether this causes any runtime issues.

@sab24, is the fix still working for you?

sab24 commented

@carlocab I don’t have a mac anymore due to Apple malpractices, so I can’t say. In two weeks I can test on another site where there are Apple computers.

I see. Do let me know if you get the chance. Thank you.

master d8d9fa4 builds on Big Sur, but still fails to run with hv_vm_create HV_ERROR (unspecified error)