Skip to content

Cross compile from x86_64 to target aarch64-unknown-linux-gnu fails due to bindings. #1712

@aarshivv

Description

@aarshivv

Checklist

Describe your issue

I’m building a Rust project on an x86_64 host using cross for the aarch64-unknown-linux-gnu target. One of the dependencies, libgssapi, generates Rust bindings from C headers at build time. These bindings are produced based on the host environment, but cross compiles the project inside an aarch64 container. As a result, the bindings are incompatible with the target architecture, causing a build failure due to an architecture mismatch.

As you can see in the screenshot, the path is of host system i.e x86_64
Image

What target(s) are you cross-compiling for?

aarch64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

cargo init test_cross
cargo add libgssapi
cargo add libgssapi-sys
cross build --target aarch64-unknown-linux-gnu

Additional information / notes

The project builds successfully when run inside an arm64 Docker container using QEMU for emulation.

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