Skip to content

DXMT: fix the supported LLVM 15 build#748

Open
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/dxmt-llvm17-build-compat
Open

DXMT: fix the supported LLVM 15 build#748
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/dxmt-llvm17-build-compat

Conversation

@moreaki

@moreaki moreaki commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Fix the in-tree DXMT build against the LLVM 15 toolchain used by the supported macOS/Arm path.

The patch is deliberately limited to build/link compatibility:

  • ask the configured llvm-config for the LLVM libraries and library directory;
  • preserve the existing static component-library list as a fallback for VirtualBox devtools trees without llvm-config;
  • include the standard allocation declarations required by current Apple Clang.

It does not rewrite DXMT for LLVM 17 or newer APIs.

Why

Hard-coded component archive paths do not match packaged LLVM installations that expose a shared libLLVM. Conversely, Oracle/devtools layouts may not ship llvm-config, so the existing static link remains necessary as a fallback.

Validation

  • Rebased and applied independently to current origin/main.
  • git diff --check passes.
  • A clean VBoxDxMt target build succeeds with Homebrew LLVM 15.0.7.
  • The integrated full build also produces VBoxDxMt.dylib.
  • otool -L VBoxDxMt.dylib resolves /opt/homebrew/opt/llvm@15/lib/libLLVM.dylib with current version 15.0.7.

Refs #742.

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the 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.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 8, 2026
@moreaki
moreaki force-pushed the agent/dxmt-llvm17-build-compat branch from 4550410 to edc4e12 Compare July 8, 2026 08:39
@moreaki moreaki changed the title DXMT: add LLVM 17 build compatibility fixes DXMT: add LLVM build compatibility fixes Jul 8, 2026
@moreaki
moreaki marked this pull request as ready for review July 8, 2026 08:45
@moreaki
moreaki force-pushed the agent/dxmt-llvm17-build-compat branch from edc4e12 to b9b0359 Compare July 8, 2026 08:51
@moreaki
moreaki marked this pull request as draft July 8, 2026 08:53
@moreaki
moreaki marked this pull request as ready for review July 8, 2026 08:55
@moreaki
moreaki force-pushed the agent/dxmt-llvm17-build-compat branch from b9b0359 to eb0e48d Compare July 8, 2026 11:07
@moreaki

moreaki commented Jul 8, 2026

Copy link
Copy Markdown
Author

I checked DXMT v0.80 before deciding whether this PR should instead be replaced by a vendored DXMT update.

Result: v0.80 does not make this compatibility patch obsolete. It includes the separate CPU encoding heap fix from upstream DXMT, but it still has LLVM API drift in the AIR converter code:

  • src/airconv/nt/air_builder.cpp syntax-checks with LLVM 15 headers, but fails with LLVM 16/17 headers on llvm::Attribute::AttrKind::ArgMemOnly.
  • With LLVM 22 headers it also fails on removed typed-pointer APIs such as getNonOpaquePointerElementType() and renamed/removed attributes such as NoCapture.
  • The legacy converter path syntax-checks with LLVM 15/16 headers, but LLVM 17 fails on the removed llvm/ADT/Optional.h include.
  • DXMT v0.80 still carries fixed LLVM component library lists in its Meson build files, so the VirtualBox kBuild llvm-config handling remains a separate build-system compatibility fix.

So a future DXMT v0.80 vendor refresh may still be valuable, but it would need its own follow-up LLVM compatibility work for the newer nt/ AIR converter paths. It is not a drop-in replacement for this PR against the current DXMT 0.60 vendor snapshot.

@moreaki

moreaki commented Jul 9, 2026

Copy link
Copy Markdown
Author

DXMT v0.80 audit update:

Updating the vendored DXMT tree to v0.80 would not currently remove the need for the source-compatibility parts of this PR. I checked DXMT v0.80 (589adb7) and current DXMT main (73d42c5); both still contain LLVM API uses such as Attribute::AttrKind::ArgMemOnly, getNonOpaquePointerElementType(), llvm::Optional, and related LLVM-version drift in the AIR conversion code.

I opened the upstream DXMT source-compatibility issue here: 3Shain/dxmt#185

The VirtualBox Makefile.kmk llvm-config portion remains a downstream integration fix for the vendored/kBuild tree. DXMT upstream also has an analogous hard-coded Meson LLVM link-list issue, so I opened that separately upstream:

If VirtualBox later imports a DXMT version that resolves those upstream items, this PR can be reduced or replaced accordingly.

Use llvm-config to select the packaged LLVM link library while preserving the static devtools fallback. Include the standard allocation declarations required by current Apple Clang.

Signed-off-by: Roberto Nibali <rnibali@gmail.com>
@moreaki
moreaki force-pushed the agent/dxmt-llvm17-build-compat branch from eb0e48d to 10f95a3 Compare July 16, 2026 14:28
@moreaki moreaki changed the title DXMT: add LLVM build compatibility fixes DXMT: fix the supported LLVM 15 build Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant