Skip to content

How to cross-compile programs from amd64 to arm64 #144

@bartsmykla

Description

@bartsmykla

I'm trying to cross-compile some of the programs built on top of libbpf-bootstrap, but I'm lacking expertise with C/C++ ecosystem. I see that support for cross-compilation was added in 7b60b4f
I would appreciate help with:

  • what are the packages I have to have installed on Ubuntu 22.04 (amd64) to cross-compile programs to arm64?
  • do I have to cross-compile libelf and zlib first? If so, any hints how can I do it?

My current results:

~ CROSS_COMPILE=aarch64-linux-gnu-g make all
  BINARY   bind
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: cannot find -lelf: No such file or directory
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: cannot find -lz: No such file or directory

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