From 6f703adcd39c7e34c5607324912d2838f1bb2224 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Wed, 15 Jul 2026 17:16:29 +0300 Subject: [PATCH] kernel: set MACOSX_DEPLOYMENT_TARGET to host version Fix a warning interpreted as error when building the Linux kernel on macOS host, by setting MACOSX_DEPLOYMENT_TARGET to the version of the host. Fixes: make[5]: Entering directory '/Volumes/test/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.18.38' HOSTCC scripts/mod/modpost.o scripts/mod/modpost.c:1719:9: error: 'strchrnul' is only available on macOS 15.4 or newer [-Werror,-Wunguarded-availability-new] 1719 | sep = strchrnul(namespace, ','); | ^~~~~~~~~ Signed-off-by: Georgi Valkov Link: https://github.com/openwrt/openwrt/pull/24251 Signed-off-by: Robert Marko --- include/kernel.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/kernel.mk b/include/kernel.mk index 1f510496620..146346a4753 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -121,6 +121,10 @@ ifneq (,$(KERNEL_CC)) KERNEL_MAKE_FLAGS += CC="$(KERNEL_CC)" endif +ifeq ($(HOST_OS),Darwin) + KERNEL_MAKE_FLAGS += MACOSX_DEPLOYMENT_TARGET="$(shell sw_vers -productVersion)" +endif + KERNEL_NOSTDINC_FLAGS = \ -nostdinc $(if $(DUMP),, -isystem $(shell $(TARGET_CC) -print-file-name=include))