Skip to content

aarch64-unknown-linux-gnu cross-compilation fails: __ARM_ARCH not defined during ARM assembly compilation #1022

@paul-brackin

Description

@paul-brackin

Problem:

When cross-compiling aws-lc-sys for aarch64-unknown-linux-gnu target, the build fails with an error indicating that __ARM_ARCH is not defined during ARM assembly file compilation. The error occurs in aws-lc/include/openssl/asm_base.h:77 when compiling ARM assembly files (e.g., arm/aes/aes-xts-dec.S). This issue has been confirmed in both v0.36.0 and v0.37.0 (latest as of Jan 23, 2026).

Error Message:

error: #error "ARM assembler must define __ARM_ARCH"
 #error "ARM assembler must define __ARM_ARCH"
  ^

Reproduction Steps:

  1. Set up cross-compilation environment for aarch64-unknown-linux-gnu (e.g., using maturin-action with manylinux Docker containers)
  2. Build a Rust project that depends on aws-lc-sys = "0.37.0" (or 0.36.0)
  3. The build fails during ARM assembly compilation phase with the __ARM_ARCH error

Environment:

  • Build tool: maturin-action (using manylinux Docker containers)
  • CI/CD: GitHub Actions
  • Docker platform: linux/arm64 (for aarch64 target)

Relevant details

AWS-LC for Rust versions or commit: aws-lc-sys = "0.36.0" (tested, has the issue), aws-lc-sys = "0.37.0" (latest as of Jan 23, 2026, tested and confirmed same issue), aws-lc-rs = "1.15.4" (direct dependency)

System information:

  • CPU architecture: x86-64 (host), aarch64 (target)
  • CPU name: GitHub Actions runner (x86_64 host)
  • OS: Ubuntu 22.04 (host), Linux (target - aarch64-unknown-linux-gnu)

Build log:

  • The log tells compiler and version.
warning: aws-lc-sys@0.37.0: In file included from /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.37.0/aws-lc/third_party/s2n-bignum/s2n-bignum-to-be-imported/arm/aes/aes-xts-dec.S:4:0:
warning: aws-lc-sys@0.37.0: /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/aws-lc-sys-0.37.0/aws-lc/include/openssl/asm_base.h:77:2: error: #error "ARM assembler must define __ARM_ARCH"
warning: aws-lc-sys@0.37.0:  #error "ARM assembler must define __ARM_ARCH"
warning: aws-lc-sys@0.37.0:   ^
error: failed to run custom build command for `aws-lc-sys v0.37.0`

Caused by:
  process didn't exit successfully: `/home/runner/work/aerospike-client-python-async/aerospike-client-python-async/target/release/build/aws-lc-sys-0b48bad560a68ec3/build-script-main` (exit status: 1)

Cross-compiler information:

  • Compiler: aarch64-unknown-linux-gnu-gcc
  • Target: aarch64-unknown-linux-gnu
  • Host: x86_64-unknown-linux-gnu
  • Rust version: 1.90.0

Build Configuration:
We're using the following environment variables to force pre-generated bindings:

AWS_LC_SYS_CMAKE_BUILDER=0
AWS_LC_SYS_EXTERNAL_BINDGEN=0
AWS_LC_SYS_NO_PREGENERATED_SRC=0

What We've Tried:

  1. Tested aws-lc-sys 0.36.0 - confirmed __ARM_ARCH issue
  2. Tested aws-lc-sys 0.37.0 (released Jan 23, 2026 with aws-lc-rs v1.15.4) - same __ARM_ARCH issue persists
  3. Set environment variables to force pre-generated bindings (AWS_LC_SYS_CMAKE_BUILDER=0, AWS_LC_SYS_EXTERNAL_BINDGEN=0, AWS_LC_SYS_NO_PREGENERATED_SRC=0)
  4. Attempted to use aws-lc-rs with bindgen feature, but this forced bindgen for all targets (including x86_64 with pre-generated bindings), requiring libclang which isn't available in manylinux Docker containers
  5. AWS_LC_SYS_NO_ASM only works for debug builds, not release builds

Expected Behavior:
The build should succeed for aarch64-unknown-linux-gnu target, as this platform is listed as having pre-generated bindings available according to the platform support documentation.

Actual Behavior:
The build fails during ARM assembly compilation because the cross-compiler (aarch64-unknown-linux-gnu-gcc) doesn't properly define __ARM_ARCH when compiling ARM assembly files (.S files). This occurs during the AWS-LC C library compilation phase, not during Rust binding generation.

Related Issues:

Workaround:
Currently, we've disabled aarch64-unknown-linux-gnu builds in our CI until this issue is resolved. We're only building for x86_64-unknown-linux-gnu and i686-unknown-linux-gnu targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions