xdp-project / xdp-tools

Utilities and example programs for use with XDP
Other
644 stars 139 forks source link

How can I cross compile for android using ndk? #402

Open xeome opened 7 months ago

xeome commented 7 months ago

I'm not familiar with the configure script this project is using, how do I cross compile for android(arm) using ndk?

I want to statically compile my project which uses libxdp and run on AOSP.

tohojo commented 7 months ago

All the build variables set in the configure script are overridable from the command line. See the list in check_toolchain():

: ${PKG_CONFIG:=pkg-config}
: ${CC=gcc}
: ${LD=ld}
: ${OBJCOPY=objcopy}
: ${CLANG=clang}
: ${LLC=llc}
: ${M4=m4}
: ${EMACS=emacs}
: ${BPFTOOL=bpftool}
: ${READELF=readelf}
: ${ARCH_INCLUDES=}
: ${ARCH_NAME=}

They can be set in the environment when running configure, like:

CC=/my/cross/compiler/cc ./configure

No idea if anything else is needed for cross-compiling...