Skip to content

Commit

Permalink
Support Big Sur (#200)
Browse files Browse the repository at this point in the history
* Support Big Sur

Based on #192 but with fixes to additional issues I've encountered.

Tested on Big Sur 11.0 Beta 10 with Xcode 12.1 and Xcode 12.2 Beta 4.

* Remove VMX flag fixes, move ARCHS from pbxproj to xcconfig
  • Loading branch information
shanesmith authored Nov 13, 2020
1 parent 1f46a3d commit b7e589f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/block_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static struct blockif_sig_elem *blockif_bse_head;
#pragma clang diagnostic pop

static ssize_t
preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
off_t res;

Expand All @@ -132,7 +132,7 @@ preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
}

static ssize_t
pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
off_t res;

Expand Down Expand Up @@ -239,7 +239,7 @@ blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf)
switch (be->be_op) {
case BOP_READ:
if (buf == NULL) {
if ((len = preadv(bc->bc_fd, br->br_iov, br->br_iovcnt,
if ((len = _preadv(bc->bc_fd, br->br_iov, br->br_iovcnt,
br->br_offset)) < 0)
err = errno;
else
Expand Down Expand Up @@ -279,7 +279,7 @@ blockif_proc(struct blockif_ctxt *bc, struct blockif_elem *be, uint8_t *buf)
break;
}
if (buf == NULL) {
if ((len = pwritev(bc->bc_fd, br->br_iov, br->br_iovcnt,
if ((len = _pwritev(bc->bc_fd, br->br_iov, br->br_iovcnt,
br->br_offset)) < 0)
err = errno;
else
Expand Down
3 changes: 3 additions & 0 deletions src/pci_e82545.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,10 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head, uint16_t tail,

/* Allocate, fill and prepend writable header vector. */
if (hdrlen != 0) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Walloca"
hdr = __builtin_alloca((size_t)(hdrlen + vlen));
#pragma clang diagnostic push
hdr += vlen;
for (left = hdrlen, hdrp = hdr; left > 0;
left -= now, hdrp += now) {
Expand Down
2 changes: 2 additions & 0 deletions xcconfigs/xhyve.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARCHS = x86_64;

CODE_SIGN_ENTITLEMENTS = src/xhyve-entitlements.plist
OTHER_CODE_SIGN_FLAGS = -o library

Expand Down
3 changes: 2 additions & 1 deletion xhyve.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
attributes = {
DefaultBuildSystemTypeForWorkspace = Latest;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "xhyve";
ORGANIZATIONNAME = xhyve;
TargetAttributes = {
3F1934911BF7C0D40099CC46 = {
CreatedOnToolsVersion = 7.3;
Expand All @@ -597,6 +597,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 3F1934891BF7C0D40099CC46;
Expand Down

1 comment on commit b7e589f

@jotbyte
Copy link

@jotbyte jotbyte commented on b7e589f Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the README:

block_if:
    macOS does not support preadv/pwritev, we need to serialize reads and writes for the time being until we find a better solution. (performance)

Please sign in to comment.