Darwin: fix current macOS/Arm build and XPCOM runtime#747
Open
moreaki wants to merge 4 commits into
Open
Conversation
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
696583a to
58be8b4
Compare
58be8b4 to
81e2f01
Compare
This was referenced Jul 16, 2026
Use the selected SDK sysroot for Darwin compile probes, prefer its libc++ headers over unrelated Homebrew GCC headers, and treat a custom Homebrew Qt path as a framework installation. Detect Homebrew Qt tools and plugins under share/qt so the generated kBuild paths also produce a complete app bundle. Signed-off-by: Roberto Nibali <rnibali@gmail.com>
81e2f01 to
13662af
Compare
Signed-off-by: Roberto Nibali <rnibali@gmail.com>
Use a raw local for the legacy out-parameter, then release it after QueryInterface. This prevents current Apple Clang from reordering the nsCOMPtr storage load before getter_AddRefs writes it. Signed-off-by: Roberto Nibali <rnibali@gmail.com>
Use the fixed-width IPRT UTF-16 type for wire lengths, allocation, and termination instead of legacy PRUnichar assumptions on current Darwin compilers. Signed-off-by: Roberto Nibali <rnibali@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make a current macOS/Arm source build work with the selected Apple SDK and Homebrew Qt 6, then keep its XPCOM management path usable with the current Clang ABI.
The pull request has four focused commits.
1. Configure and Qt layout
-isysroot;include/c++;--with-qt-pathas a framework root;-Fpaths fromQtCore.framework;share/qt/libexecand plugins inshare/qt/plugins.2. Compiler-proven source blockers
QCharstorage type;3. XPCOM generic-factory output
With the clean build,
VBoxManage --versionworked butVBoxManage list vmsreproducibly exited on SIGSEGV. BothVBoxManageandVBoxSVCcrashed innsGenericModule::GetClassObjectat the factoryQueryInterfacecall because the generated current-Clang code dereferenced a null smart pointer after the aliased output call.Use a raw temporary only for the factory output, query it, and release it. This preserves the ownership transfer while removing the aliased smart-pointer output.
4. XPCOM IPC UTF-16 width
After the factory crash was removed,
VBoxManage list vmsreturned a truncated name and UUID:The IPC wire format is UTF-16, but the legacy
PRUnicharassumptions do not reliably remain two bytes in this current Darwin component build. Measure, allocate, terminate, and copy with IPRT's fixed-widthRTUTF16types while preserving the existing XPCOM-facing pointer type.Scope
Every configure/source change corresponds to a clean-build compiler failure or an exact management-command runtime failure on macOS/Arm with SDK 26.5 and Qt 6.11.1. The Hypervisor availability handling remains compile-time-only; the macOS 15 APIs continue to be resolved and gated dynamically at runtime.
Non-Darwin configure behavior and Oracle/devtools Qt layouts are unchanged. The factory ownership sequence is semantically unchanged, and the IPC change makes the existing two-byte wire contract explicit.
Reproduction and validation
Configure:
./configure.py --disable-hardening \ --with-kbuild-path=/path/to/kBuild \ --with-macossdk-path=$(xcrun --sdk macosx --show-sdk-path) \ --with-xcode-path=/Library/Developer/CommandLineTools \ --with-qt-path=/opt/homebrew/opt/qtValidated results:
git diff --checkandpython3 -m py_compile configure.pypass.libqcocoa.dylib.kmk -j6build passed for the configure/compiler changes.kmk -j6 VBoxXPCOM VBoxXPCOMIPCCand the dependentVirtualBoxVMtarget pass.VBoxManage list vmsexits 0 and returns the complete value:VBoxManage showvminfo Win11 --machinereadablealso returns the full name/path and reports the expectedvboxsvga, 3D-enabled, 256 MiB VRAM configuration.Refs #742.