Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 30 additions & 12 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,9 @@ def compileAndRun(sName, asIncPaths, asLibPaths, asIncFiles, asLibFiles, \
asCmd.extend( [ sFileSource ] );
asCmd.extend( [ '/Fe:' + sFileImage ] );
else: # Non-Windows
if enmBuildTarget == BuildTarget.DARWIN \
and g_oEnv['VBOX_PATH_MACOSX_SDK']:
asCmd.extend([ '-isysroot', g_oEnv['VBOX_PATH_MACOSX_SDK'] ]);
if asIncPaths:
for sIncPath in asIncPaths:
asCmd.extend( [ f'-I{sIncPath}' ] );
Expand Down Expand Up @@ -1414,8 +1417,8 @@ def getIncSearchPaths(self):
# macOS (Darwin)
#
elif self.enmBuildTarget == BuildTarget.DARWIN:
asPaths.extend([ '/opt/homebrew/include',
os.path.join(g_oEnv['VBOX_PATH_MACOSX_SDK'], 'usr', 'include', 'c++', 'v1') ]);
asPaths.extend([ os.path.join(g_oEnv['VBOX_PATH_MACOSX_SDK'], 'usr', 'include', 'c++', 'v1'),
'/opt/homebrew/include' ]);

#
# Linux
Expand Down Expand Up @@ -1764,8 +1767,12 @@ def checkCallback_qt(self):
sPathBin = None;
sPathLibExec = None;

# Check if we have our own pre-compiled Qt in tools first.
sPathBase = self.getToolPath();
# Check if we have our own pre-compiled Qt in tools first. A custom
# Darwin path may point at a normal framework installation instead.
if self.enmBuildTarget == BuildTarget.DARWIN and self.sRootPath:
sPathBase = None;
else:
sPathBase = self.getToolPath();
if sPathBase:
self.asLibFiles = [ 'libQt6CoreVBox' ];
g_oEnv.set('VBOX_WITH_ORACLE_QT', '1');
Expand Down Expand Up @@ -1803,10 +1810,11 @@ def checkCallback_qt(self):

# Search for the library file.
# Note: Ordered by precedence. Do not change!
asPath = [ sPathBase,
getPackagePath('qt@6')[1],
'/System/Library',
'/Library' ];
asPath = [ self.sRootPath,
sPathBase,
getPackagePath('qt@6')[1],
'/System/Library',
'/Library' ];
sPathFramework = None;
for sPathBase in asPath:
if not sPathBase: # No custom path? Skip.
Expand All @@ -1825,23 +1833,33 @@ def checkCallback_qt(self):
break;

if sPathFramework:
sPathFrameworkParent = os.path.dirname(sPathFramework);
# We need to clear the library defined the the LibraryCheck definition
# -- macOS uses the framework concept instead.
self.asLibFiles = [];
self.asLibPaths.insert(0, sPathFramework);
self.asLibPaths.insert(0, sPathFrameworkParent);
# Include the framework headers.
self.asIncPaths.insert(0, f'{sPathBase}/lib/QtCore.framework/Headers');
self.asIncPaths.insert(0, os.path.join(sPathFramework, 'Headers'));
# More stuff needed in order to get it linked.
self.asLinkerArgs.extend([ '-std=c++17', '-framework', 'QtCore', '-F', f'{sPathBase}/lib', '-g', '-O', '-Wall' ]);
self.asCompilerArgs.extend([ '-F', sPathFrameworkParent ]);
self.asLinkerArgs.extend([ '-std=c++17', '-framework', 'QtCore', '-F', sPathFrameworkParent, '-g', '-O', '-Wall' ]);

sPkgName = 'Qt6Core'; ## @todo Make the code generic once we have similar SDKs.
if sPathBase:
g_oEnv.set( 'VBOX_PATH_QT', sPathBase);
g_oEnv.set(f'PATH_SDK_{self.sSdkName}', sPathBase);
sPathSdk = sPathBase;
sPathBin = os.path.join(sPathBase, 'bin');
sPathInc = os.path.join(sPathBase, 'include');
sPathLib = os.path.join(sPathBase, 'lib');
sPathLibExec = os.path.join(sPathBase, 'libexec');
if self.enmBuildTarget == BuildTarget.DARWIN:
sPathQtData = os.path.join(sPathBase, 'share', 'qt');
if isDir(os.path.join(sPathQtData, 'plugins')):
sPathSdk = sPathQtData;
sPathQtLibExec = os.path.join(sPathQtData, 'libexec');
if isDir(sPathQtLibExec):
sPathLibExec = sPathQtLibExec;
g_oEnv.set(f'PATH_SDK_{self.sSdkName}', sPathSdk);

if self.enmBuildTarget != BuildTarget.WINDOWS:
# Tell g++ that we need C++17 -- otherwise Qt6 won't compile.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ QString UINativeHotKey::toString(int iKeyCode)
{
case shiftKey:
case rightShiftKey:
strKeyName = strKeyName.arg(QChar(kShiftUnicode));
strKeyName = strKeyName.arg(QChar(static_cast<ushort>(kShiftUnicode)));
break;
case optionKey:
case rightOptionKey:
strKeyName = strKeyName.arg(QChar(kOptionUnicode));
strKeyName = strKeyName.arg(QChar(static_cast<ushort>(kOptionUnicode)));
break;
case controlKey:
case rightControlKey:
strKeyName = strKeyName.arg(QChar(kControlUnicode));
strKeyName = strKeyName.arg(QChar(static_cast<ushort>(kControlUnicode)));
break;
case cmdKey:
case kEventKeyModifierRightCmdKeyMask:
strKeyName = strKeyName.arg(QChar(kCommandUnicode));
strKeyName = strKeyName.arg(QChar(static_cast<ushort>(kCommandUnicode)));
break;
}

Expand Down
3 changes: 2 additions & 1 deletion src/VBox/Main/src-server/darwin/HostDnsServiceDarwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ int HostDnsServiceDarwin::updateInfo(void)
{
CFStringRef const serverAddressRef = (CFStringRef)CFArrayGetValueAtIndex(serverArrayRef, i);
if (serverAddressRef)
{
if (!queryCFStringAsUtf8Str(serverAddressRef, strTmp, _16K))
{
LogRel(("HostDnsServiceDarwin: idx: %u: Failed to convert address.\n", i));
Expand Down Expand Up @@ -273,6 +274,7 @@ int HostDnsServiceDarwin::updateInfo(void)
}
else
LogRel(("HostDnsServiceDarwin: line %u: bad nameserver address %s\n", i, strTmp.c_str()));
}
}
}

Expand Down Expand Up @@ -313,4 +315,3 @@ void HostDnsServiceDarwin::Data::performShutdownCallback(void *pInfo)
AssertPtrReturnVoid(pThis->m);
ASMAtomicXchgBool(&pThis->m->m_fStop, true);
}

3 changes: 1 addition & 2 deletions src/VBox/Main/src-server/darwin/HostPowerDarwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void HostPowerServiceDarwin::checkBatteryCriticalLevel(bool *pfCriticalChanged)
result = CFDictionaryGetValueIfPresent(pSource, CFSTR(kIOPSDeadWarnLevelKey), &psValue);
if (result)
CFNumberGetValue((CFNumberRef)psValue, kCFNumberSInt32Type, &criticalValue);
critical = remCapacity < criticalValue;
critical = remCapacity < (float)criticalValue;

/* We have to take action only if we are on battery, the
* previous state wasn't critical, the state has changed & the
Expand All @@ -249,4 +249,3 @@ void HostPowerServiceDarwin::checkBatteryCriticalLevel(bool *pfCriticalChanged)
CFRelease(pBlob);
CFRelease(pSources);
}

20 changes: 14 additions & 6 deletions src/VBox/VMM/VMMR3/target-armv8/NEMR3Native-darwin-armv8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
* Structures and Typedefs *
*********************************************************************************************************************************/

#if MAC_OS_X_VERSION_MIN_REQUIRED < 150000
#if !__has_include(<Hypervisor/hv_gic_types.h>)

/* Since 15.0+ */
typedef enum hv_gic_distributor_reg_t : uint16_t
Expand Down Expand Up @@ -138,12 +138,17 @@ typedef enum hv_gic_intid_t : uint16_t
HV_GIC_INT_PERFORMANCE_MONITOR = 30
} hv_gic_intid_t;

# define HV_SYS_REG_ACTLR_EL1 (hv_sys_reg_t)0xc081

#else
# define HV_GIC_ICC_REG_INVALID (hv_gic_icc_reg_t)UINT16_MAX
#endif

#define VBOX_HV_SYS_REG_ACTLR_EL1 (hv_sys_reg_t)0xc081

#if MAC_OS_X_VERSION_MIN_REQUIRED < 150000
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunguarded-availability-new"
#endif

typedef hv_vm_config_t FN_HV_VM_CONFIG_CREATE(void);
typedef hv_return_t FN_HV_VM_CONFIG_GET_EL2_SUPPORTED(bool *el2_supported);
typedef hv_return_t FN_HV_VM_CONFIG_GET_EL2_ENABLED(hv_vm_config_t config, bool *el2_enabled);
Expand Down Expand Up @@ -193,6 +198,10 @@ typedef hv_return_t FN_HV_GIC_SET_REDISTRIBUTOR_REG(hv_vcpu_t vcpu, hv_gic_r

typedef hv_return_t FN_HV_GIC_GET_INTID(hv_gic_intid_t interrupt, uint32_t *intid);

#if MAC_OS_X_VERSION_MIN_REQUIRED < 150000
# pragma clang diagnostic pop
#endif


/**
* ARM PSCI Affinity info arguments.
Expand Down Expand Up @@ -559,7 +568,7 @@ static const struct
uint32_t offCpumCtx;
} s_aCpumSysRegsSequioa[] =
{
{ HV_SYS_REG_ACTLR_EL1, CPUMCTX_EXTRN_SYSREG_MISC, RT_UOFFSETOF(CPUMCTX, Actlr.u64) }
{ VBOX_HV_SYS_REG_ACTLR_EL1, CPUMCTX_EXTRN_SYSREG_MISC, RT_UOFFSETOF(CPUMCTX, Actlr.u64) }
};
/** EL2 support system registers. */
static const struct
Expand Down Expand Up @@ -1045,7 +1054,7 @@ static int nemR3DarwinCopyStateFromHv(PVMCC pVM, PVMCPUCC pVCpu, uint64_t fWhat)
* https://github.com/AsahiLinux/docs/blob/main/docs/hw/cpu/system-registers.md#actlr_el1-arm-standard-not-standard
* But the ones being set are not documented. Maybe they are always set by the Hypervisor...
*/
if (s_aCpumSysRegsSequioa[i].enmHvReg == HV_SYS_REG_ACTLR_EL1)
if (s_aCpumSysRegsSequioa[i].enmHvReg == VBOX_HV_SYS_REG_ACTLR_EL1)
*pu64 &= RT_BIT_64(1);
}
}
Expand Down Expand Up @@ -3476,4 +3485,3 @@ VMM_INT_DECL(uint32_t) NEMHCGetFeatures(PVMCC pVM)
*
* @todo Add notes as the implementation progresses...
*/

15 changes: 8 additions & 7 deletions src/libs/xpcom18a4/ipc/ipcd/client/src/ipcDConnectService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
# include <iprt/mem.h>
# include <iprt/time.h>
# include <iprt/thread.h>
# include <iprt/utf16.h>

# include <VBox/log.h>
#endif /* VBOX */
Expand Down Expand Up @@ -390,7 +391,7 @@ SerializeParam(PIPCMSGWRITER pMsgWriter, const nsXPTType &t, const nsXPTCMiniVar
{
if (v.val.p)
{
int len = 2 * nsCRT::strlen((const PRUnichar *) v.val.p);
PRUint32 len = (PRUint32)(RTUtf16Len((PCRTUTF16)v.val.p) * sizeof(RTUTF16));
IPCMsgWriterPutU32(pMsgWriter, len);
IPCMsgWriterPutBytes(pMsgWriter, v.val.p, len);
}
Expand Down Expand Up @@ -538,11 +539,11 @@ DeserializeParam(PIPCMSGREADER pMsgReader, const nsXPTType &t, nsXPTCVariant &v)
}
else
{
PRUnichar *buf = (PRUnichar *)RTMemAlloc(len + 2);
PRTUTF16 buf = (PRTUTF16)RTMemAlloc(len + sizeof(RTUTF16));
IPCMsgReaderReadBytes(pMsgReader, buf, len);
buf[len / 2] = PRUnichar(0);
buf[len / sizeof(RTUTF16)] = RTUTF16(0);

v.val.p = buf;
v.val.p = (PRUnichar *)buf;
v.SetValIsAllocated();
}
}
Expand Down Expand Up @@ -786,11 +787,11 @@ DeserializeResult(PIPCMSGREADER pMsgReader, const nsXPTType &t, nsXPTCMiniVarian
}
else
{
PRUnichar *buf = (PRUnichar *)RTMemAlloc(len + 2);
PRTUTF16 buf = (PRTUTF16)RTMemAlloc(len + sizeof(RTUTF16));
IPCMsgReaderReadBytes(pMsgReader, buf, len);
buf[len / 2] = PRUnichar(0);
buf[len / sizeof(RTUTF16)] = RTUTF16(0);

*((PRUnichar **) v.val.p) = buf;
*((PRUnichar **) v.val.p) = (PRUnichar *)buf;
}
}
break;
Expand Down
8 changes: 5 additions & 3 deletions src/libs/xpcom18a4/xpcom/glue/nsGenericFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,12 @@ nsGenericModule::GetClassObject(nsIComponentManager *aCompMgr,
const nsModuleComponentInfo* desc = mComponents;
for (PRUint32 i = 0; i < mComponentCount; i++) {
if (desc->mCID.Equals(aClass)) {
nsCOMPtr<nsIGenericFactory> fact;
rv = NS_NewGenericFactory(getter_AddRefs(fact), desc);
nsIGenericFactory *fact = NULL;
rv = NS_NewGenericFactory(&fact, desc);
if (NS_FAILED(rv)) return rv;
return fact->QueryInterface(aIID, r_classObj);
rv = fact->QueryInterface(aIID, r_classObj);
NS_RELEASE(fact);
return rv;
}
desc++;
}
Expand Down