-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
ARM64EC static libraries fail when linked into ARM64X DLLs #145154
Copy link
Copy link
Open
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.O-arm64ec-pc-windows-msvcTarget: arm64ec-pc-windows-msvcTarget: arm64ec-pc-windows-msvcO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.O-arm64ec-pc-windows-msvcTarget: arm64ec-pc-windows-msvcTarget: arm64ec-pc-windows-msvcO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Rust-generated ARM64EC static libraries cause crashes (0xc0000096 - privileged instruction) when statically linked into ARM64X DLLs and loaded by x64 processes on ARM64 Windows. The same scenario works correctly with MSVC-compiled ARM64EC static libraries.
Environment
arm64ec-pc-windows-msvcSteps to Reproduce
aarch64-pc-windows-msvcandarm64ec-pc-windows-msvc/machine:arm64xAttached arm64x-rust-test.zip for minimal reproducible example
Expected Behavior
The ARM64X DLL should load successfully in x64 processes, with the ARM64EC code handling the x64 emulation layer properly, just as it does with MSVC-compiled ARM64EC static libraries.
Actual Behavior
x64 processes crash immediately upon loading the ARM64X DLL with error 0xc0000096 (privileged instruction).
Additional Context
This suggests the issue is specific to the static library format and how the ARM64X linker processes Rust-generated ARM64EC objects.
Workarounds
This issue affects any Windows on ARM application trying to use Rust in system components that must support both ARM64 and x64 processes (like Text Services Framework, shell extensions, COM servers, etc.).