From: Jonas Gorski Date: Wed, 18 Jun 2025 08:46:35 +0000 (+0200) Subject: iproute2: point KERNEL_INCLUDE to toolchain headers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d015a39dd39fe5178f1be3d5e7cee9368d4f9935;p=thirdparty%2Fopenwrt.git iproute2: point KERNEL_INCLUDE to toolchain headers Glibc since 2.41 tries to include linux/sched/types.h from sched.h, and pointing KERNEL_INCLUDE to the kernel headers makes it use linux/sched/types.h from the kernel headers instead of the installed one. This then breaks the configure (test) compile for setns() and the test: mips-openwrt-linux-gnu-gcc -I/fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi -o config.HaAJYe/setnstest config.HaAJYe/setnstest.c In file included from /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/sched/types.h:5, from /fork.openwrt/staging_dir/toolchain-mips_24kc_gcc-14.3.0_glibc/include/bits/sched.h:63, from /fork.openwrt/staging_dir/toolchain-mips_24kc_gcc-14.3.0_glibc/include/sched.h:43, from config.HaAJYe/setnstest.c:2: /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" [-Wcpp] 10 | #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" | ^~~~~~~ In file included from /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/posix_types.h:5, from /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/types.h:14: /fork.openwrt/build_dir/target-mips_24kc_glibc/linux-ath79_generic/linux-6.6.93/include/uapi/linux/stddef.h:5:10: fatal error: linux/compiler_types.h: No such file or directory 5 | #include | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Fix this by pointing KERNEL_INCLUDE to the toolchain headers, which include the installed kernel headers. Tested with musl, glibc, and SDK. Fixes: 60738feded ("iproute2: Fix KERNEL_INCLUDE in SDK") Reported-by: Signed-off-by: Konstantin Demin Signed-off-by: Jonas Gorski --- diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 6a172d2abe9..6a1b15e148c 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -170,7 +170,7 @@ TARGET_LDFLAGS += -Wl,--as-needed TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny MAKE_FLAGS += \ - KERNEL_INCLUDE="$(LINUX_DIR)/include/uapi" \ + KERNEL_INCLUDE="$(TOOLCHAIN_ROOT_DIR)/usr/include" \ SHARED_LIBS=$(SHARED_LIBS) \ IP_CONFIG_TINY=$(IP_CONFIG_TINY) \ BUILD_VARIANT=$(BUILD_VARIANT) \