Cross-compiling hostapd

Hi,

have anyone tried cross-compiling hostapd for armhf/aarch64?

i’ve found this:

https://wiki.beyondlogic.org/index.php?title=Cross_Compiling_iw_wpa_supplicant_hostapd_rfkill_for_ARM

where i downloaded libnl from other source and replaced configure line with these:

wget https://github.com/thom311/libnl/releases/download/libnl3_5_0/libnl-3.5.0.tar.gz
tar -xzf libnl-3.5.0.tar.gz
cd libnl-3.5.0/
./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabihf
make

last git repo i’ve found (https://github.com/tgraf/libnl.git, official git on infradead is not clonable) does not contain the configure script

also http://w1.fi/hostap.git does not contain configure-script, readme and files in doc-folder do not contain any build-instructions and no Makefile…i want to use new hostap to get rid of the “netlink: ‘hostapd’: attribute type 213 has an invalid length.” in newer Kernel-versions

We compile it inside qemu chroot since ever - if that helps you in any way:

Where did i find code for chroot and compile itself?

Files in hostapd*.debian look like only controlfiles for deb packaging

If you don’t want to mess around, get our tools and run any image (choose desired release: buster, bionic, …) with EXTERNAL_NEW=“compile” … this will construct minimal file system and compile those packages with proper compiler. Before you run compile, patch / add patch sources with whatever you need.

Probably messier way is construction your own script based on https://github.com/armbian/build/blob/master/lib/chroot-buildpackages.sh

1 Like

Thank you, seems the key is

Which is called by buildpackages.sh after creating the chroot…i will try your way creating a armhf/aarch64 chroot (already done for r2/r64 images) and build hostapd inside of this.

which packets are installed by default (not listed in hostapd config)? like git,gcc,make,… (seems these 3 Packages are enough…had build hostapd in my chroot)

after cloning i need to copy defconfig to .config in folder hostapd before running make

where is this done in your system?

# file hostapd hostapd_cli
hostapd:     ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=2d7ee6b7ee317815833bdc3e859cdd71a98d085a, with debug_info, not stripped
hostapd_cli: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=bd9ccf4d2a886e88ad3f046a12ef37b5459fc51d, with debug_info, not stripped

i guess i need a stretch chroot for my stretch-target-system

./hostapd: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ./hostapd)
./hostapd: /usr/lib/arm-linux-gnueabihf/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by ./hostapd)