xdp-tools: fix compilation wrongly using host header
[openwrt/staging/stintel.git] / package / network / utils / xdp-tools / patches / 023-libxdp-fix-compilation-on-multiarch-systems.patch
1 From cb1ef3322671a67e2050a3eee18b49cdb4ed4bed Mon Sep 17 00:00:00 2001
2 From: Andre Heider <a.heider@gmail.com>
3 Date: Wed, 18 Jan 2023 20:54:41 +0100
4 Subject: [PATCH] libxdp: fix compilation on multiarch systems
5
6 Multiarch systems require an additional include path, which is covered
7 by ARCH_INCLUDES here. Just as lib/util, add it to BPF_CFLAGS.
8
9 Fixes compilation on debian:
10
11 In file included from xdp-dispatcher.c:3:
12 In file included from ../../headers/linux/bpf.h:11:
13 /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
14
15 Signed-off-by: Andre Heider <a.heider@gmail.com>
16 ---
17 lib/libxdp/Makefile | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 --- a/lib/libxdp/Makefile
21 +++ b/lib/libxdp/Makefile
22 @@ -30,7 +30,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc
23 TEMPLATED_SOURCES := xdp-dispatcher.c
24
25 CFLAGS += -I$(HEADER_DIR)
26 -BPF_CFLAGS += -I$(HEADER_DIR)
27 +BPF_CFLAGS += -I$(HEADER_DIR) $(ARCH_INCLUDES)
28
29
30 ifndef BUILD_STATIC_ONLY