mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-13 21:58:06 +04:00
The configure script of xdp-tools sets ARCH_INCLUDES only from the multiarch directory of a native compiler. For a cross compiler it stays empty, and clang takes <linux/types.h> for the BPF programs from /usr/include of the host. On hosts that have <asm/types.h> only in the multiarch directory, such as Debian without gcc-multilib, the build fails: /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found Add the include directories of the toolchain with -idirafter. They are searched after the headers of xdp-tools and of the system, as the multiarch directory of a native build, so they do not replace the Linux headers that xdp-tools ships. The target compiler already has them as system directories. The configure script also tests for bpftool with the bash redirection &>. /bin/sh may be dash, which runs the command in the background instead, so configure drops a working bpftool and takes the output of whereis. Add a second patch that uses >/dev/null 2>&1, which every shell supports. Signed-off-by: John Crispin <john@phrozen.org>