Skip to content

[Bug]: Build fails on ARM64 (aarch64) due to x86-specific assembly in SUPR3HardenedMainA-posix.asm - requires VBOX_WITHOUT_HARDENING=1 #831

Description

@sergiomb2

Version

7.2.16

Host OS Type

Linux

Host OS name + version

Fedora 43 , 44 , 45 and rawhide

Host Architecture

ARM

Guest OS Type

all

Guest Architecture

ARM

Guest OS name + version

No response

Component

Unspecified

What happened?

When attempting to build VirtualBox 7.2.16 on Fedora Rawhide ARM64 (aarch64), the build fails during compilation of src/VBox/HostDrivers/Support/posix/SUPR3HardenedMainA-posix.asm.

The assembler errors indicate that the file contains x86/x86_64-specific assembly instructions (e.g., push rdi, push rsi, mov xBP,xSP, sub esp,4, etc.) which are not valid for ARM64 architecture.

Error excerpt:

/builddir/build/BUILD/VirtualBox-7.2.16-build/VirtualBox-7.2.16/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMainA-posix.asm:1: Error: unknown mnemonic `supr3hardenedmaina' -- `supr3hardenedmaina-posix.asm $'
/builddir/build/BUILD/VirtualBox-7.2.16-build/VirtualBox-7.2.16/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMainA-posix.asm:68: Error: unknown mnemonic `push' -- `push xBP'
/builddir/build/BUILD/VirtualBox-7.2.16-build/VirtualBox-7.2.16/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMainA-posix.asm:73: Error: unknown mnemonic `push' -- `push rdi'
/builddir/build/BUILD/VirtualBox-7.2.16-build/VirtualBox-7.2.16/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMainA-posix.asm:76: Error: expected a register at operand 1 -- `sub esp,4'
...
kmk: *** [/usr/share/kBuild/footer-pass2-compiling-targets.kmk:292: /builddir/build/BUILD/VirtualBox-7.2.16-build/VirtualBox-7.2.16/out/linux.arm64/release/obj/SUPR3HardenedStatic/posix/SUPR3HardenedMainA-posix.o] Error 1

How can we reproduce this?

Workaround:

The build succeeds when hardening is disabled by setting:

kmk VBOX_WITHOUT_HARDENING=1

**Suggested fix: (this is perplexity.ai talking) **

The hardening assembly code in SUPR3HardenedMainA-posix.asm appears to be x86/x86_64-specific and needs either:

  1. An ARM64 implementation of the hardening assembly, or
  2. Conditional compilation to skip this file on non-x86 architectures, or
  3. Automatic detection to disable hardening on ARM64 when no implementation exists

Build logs:

Environment:

  • VirtualBox version: 7.2.16
  • Host OS: Fedora Rawhide aarch64
  • Build system: kBuild with RPM spec from RPM Fusion
  • Architecture: ARM64 (aarch64)

**Impact: (also is perplexity.ai talking **

This prevents building VirtualBox for ARM64 Linux distributions without disabling the hardening feature. While the workaround works, it would be better if the build system automatically detected the lack of ARM64 hardening support and either:

  • Disabled it by default on ARM64, or
  • Provided a clear error message suggesting VBOX_WITHOUT_HARDENING=1

Did you upload all of your necessary log files, screenshots, etc.?

  • Yes, I've uploaded all pertinent files to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions