From fad85c3fd5b7c64845100b6556053542de3aa814 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Thu, 29 Apr 2021 08:26:03 +0200 Subject: [PATCH] virtualbox6: fix build errors with gcc 10 Fixes #4105 --- repos/ports/ports/virtualbox6.hash | 2 +- repos/ports/src/virtualbox6/dummies.cc | 1 + repos/ports/src/virtualbox6/nem.cc | 6 +++--- .../ports/src/virtualbox6/patches/narrowing.patch | 15 +++++++++++++++ repos/ports/src/virtualbox6/patches/series | 1 + 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 repos/ports/src/virtualbox6/patches/narrowing.patch diff --git a/repos/ports/ports/virtualbox6.hash b/repos/ports/ports/virtualbox6.hash index 020029192a..ea78718a97 100644 --- a/repos/ports/ports/virtualbox6.hash +++ b/repos/ports/ports/virtualbox6.hash @@ -1 +1 @@ -aac8fe9dc30f5bc1488916af29e03d62199ac4ff +0cabc6a3f8e2884326dabeb1768916704dfdd115 diff --git a/repos/ports/src/virtualbox6/dummies.cc b/repos/ports/src/virtualbox6/dummies.cc index 0f1e59426e..97da7f09b2 100644 --- a/repos/ports/src/virtualbox6/dummies.cc +++ b/repos/ports/src/virtualbox6/dummies.cc @@ -210,6 +210,7 @@ RTDECL(int) RTSystemQueryTotalRam(uint64_t *pcb) STOP /* HostDnsServiceResolvConf.cpp */ +#include #include "HostDnsService.h" HostDnsServiceResolvConf::~HostDnsServiceResolvConf() { } diff --git a/repos/ports/src/virtualbox6/nem.cc b/repos/ports/src/virtualbox6/nem.cc index 4697d35808..8f08b157b4 100644 --- a/repos/ports/src/virtualbox6/nem.cc +++ b/repos/ports/src/virtualbox6/nem.cc @@ -472,9 +472,9 @@ void nemHCNativeNotifyPhysPageProtChanged(PVMCC pVM, RTGCPHYS GCPhys, RTHCPHYS H ::uint8_t *pu2State) { Sup::Nem::Protection const prot { - .readable = fPageProt & NEM_PAGE_PROT_READ, - .writeable = fPageProt & NEM_PAGE_PROT_WRITE, - .executable = fPageProt & NEM_PAGE_PROT_EXECUTE, + .readable = (fPageProt & NEM_PAGE_PROT_READ) != 0, + .writeable = (fPageProt & NEM_PAGE_PROT_WRITE) != 0, + .executable = (fPageProt & NEM_PAGE_PROT_EXECUTE) != 0, }; /* diff --git a/repos/ports/src/virtualbox6/patches/narrowing.patch b/repos/ports/src/virtualbox6/patches/narrowing.patch new file mode 100644 index 0000000000..f5ef0fd088 --- /dev/null +++ b/repos/ports/src/virtualbox6/patches/narrowing.patch @@ -0,0 +1,15 @@ +Fix 'narrowing conversion' error + +diff --git a/src/virtualbox6/src/VBox/Main/src-client/ConsoleImpl2.cpp b/src/virtualbox6/src/VBox/Main/src-client/ConsoleImpl2.cpp +index 3693927..6975ed2 100644 +--- a/src/virtualbox6/src/VBox/Main/src-client/ConsoleImpl2.cpp ++++ b/src/virtualbox6/src/VBox/Main/src-client/ConsoleImpl2.cpp +@@ -5262,7 +5262,7 @@ int Console::i_configNetwork(const char *pszDevice, + { + switch (hrc) + { +- case VERR_ACCESS_DENIED: ++ case E_ACCESSDENIED: + return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( + "Failed to open '/dev/net/tun' for read/write access. Please check the " + "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or " diff --git a/repos/ports/src/virtualbox6/patches/series b/repos/ports/src/virtualbox6/patches/series index c2b7fbcb2d..cd55180360 100644 --- a/repos/ports/src/virtualbox6/patches/series +++ b/repos/ports/src/virtualbox6/patches/series @@ -1,3 +1,4 @@ serial.patch drvtap.patch qemu-xhci.patch +narrowing.patch