DXMT: add LLVM build compatibility fixes#748
Open
moreaki wants to merge 1 commit 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. |
4550410 to
edc4e12
Compare
edc4e12 to
b9b0359
Compare
Derive VBoxDxMt LLVM link libraries from llvm-config when available, so shared libLLVM installs are not tied to a hard-coded LLVM major version. Keep the existing component-library list as a fallback for devtools trees without llvm-config. Keep the AIR argmemonly attribute source-compatible with LLVM 15 and LLVM 16+ by using the older enum attribute before the MemoryEffects API. Remove remaining AIR conversion dependencies on typed pointer introspection by passing explicit element types into GEP construction. For LLVM 15 typed-pointer builds, preserve the aggregate element type where needed so IRBuilder does not assert on mismatched GEP source element types. Use a local shuffle-mask sentinel to avoid depending on LLVM-version-specific names. Signed-off-by: Roberto Nibali <rnibali@gmail.com>
b9b0359 to
eb0e48d
Compare
This was referenced Jul 8, 2026
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
Add minimal DXMT/LLVM compatibility fixes. These are independent from the earlier GUI repaint and HiDPI work.
The
VBoxDxMtlink now derives LLVM libraries from the configuredllvm-configwhen available. That avoids hard-coding a HomebrewlibLLVM-N.dylibname and supports shared LLVM packages, while preserving the original component-library list as a fallback for Oracle/devtools trees withoutllvm-config.The AIR
argmemonlyattribute handling is version-gated: LLVM 15 and older use the original enum attribute path, while LLVM 16 and newer use theMemoryEffectsAPI required by LLVM 17+.The AIR/DXBC conversion code now passes explicit element types into GEP construction instead of relying on typed-pointer introspection. For LLVM 15 typed-pointer builds, the vector-array helper preserves the aggregate element type where needed so
IRBuilder::CreateGEPdoes not assert on mismatched source element types. The shuffle-mask sentinel is also kept local so the code is not tied to an LLVM-version-specific mask constant name.Why
The pointer/API issues are real DXMT/LLVM compatibility bugs:
getNonOpaquePointerElementType()is invalid once LLVM opaque pointers are in use.ArgMemOnlyversusMemoryEffects::argMemOnly()is LLVM API drift.Compatibility note
This patch intentionally does not hard-code
libLLVM-15.dylib. The source should build against LLVM 15 and newer LLVM APIs where possible, while keeping the link flexible throughllvm-configand preserving the static component-library fallback.On the macOS/Arm test host, the installed VirtualBox 7.2.12
VBoxDxMt.dylibdoes not have a dynamiclibLLVM-17.dylibdependency according tootool -L. It contains LLVM symbols directly, andstringsreportsllvm-mc (based on LLVM 15.0.7). That suggests the shipped binary may still be produced through an LLVM 15-era static component-library toolchain.For the macOS/Arm Metal/AIR path, LLVM 15.0.7 is the currently verified producer. Local LLVM 17/22 builds can get further through the source build, but newer upstream LLVM bitcode may not be accepted by Apple's Metal compiler without a downgrade/normalization layer or a different shader handoff boundary; this showed up locally as
Failed to upgrade function bitcode.Validation
origin/main.git diff --checkpasses.VBoxDxMtsuccessfully with Homebrew LLVM 15.0.7:VBOX_LLVM_PATH=/opt/homebrew/opt/llvm@15VBOX_LLVM_CONFIG=/opt/homebrew/opt/llvm@15/bin/llvm-configotool -L out/darwin.arm64/release/dist/VirtualBox.app/Contents/MacOS/VBoxDxMt.dylibshows/opt/homebrew/opt/llvm@15/lib/libLLVM.dylibwith current version15.0.7.Refs #742.