[openwrt/openwrt] bpf: also include toolchain standard header as system header

LEDE Commits lede-commits at lists.infradead.org
Mon Jun 17 04:51:15 PDT 2024


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5f9fb964c3afbcbc6ca860c817076221d0c1ce8c

commit 5f9fb964c3afbcbc6ca860c817076221d0c1ce8c
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sun May 5 17:48:31 2024 +0200

    bpf: also include toolchain standard header as system header
    
    Also include toolchain standard header as system header. These are
    required by xdp-tools that try to include stddef.h and stdbool.h for
    some tools. These header are usually in /lib/gcc/../include but musl
    also have some special variant in /include.
    
    To fix compilation of xdp-tools, also include these standard header.
    These header should follow ISO C standard and should not introduce
    regression in bpf tools making them specific to an arch.
    
    Link: https://github.com/openwrt/openwrt/pull/15390
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/bpf.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/bpf.mk b/include/bpf.mk
index 9abc660123..85c3edb4c7 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -33,7 +33,8 @@ BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
 BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
 
 BPF_KERNEL_INCLUDE := \
-	-nostdinc $(patsubst %,-isystem %,$(TOOLCHAIN_INC_DIRS)) \
+	-nostdinc -isystem $(TOOLCHAIN_ROOT_DIR)/lib/gcc/*/*/include \
+	$(patsubst %,-isystem%,$(TOOLCHAIN_INC_DIRS)) \
 	-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include \
 	-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic \
 	-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated \




More information about the lede-commits mailing list