]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
kernel: set MACOSX_DEPLOYMENT_TARGET to host version 24251/head
authorGeorgi Valkov <gvalkov@gmail.com>
Wed, 15 Jul 2026 14:16:29 +0000 (17:16 +0300)
committerRobert Marko <robimarko@gmail.com>
Thu, 16 Jul 2026 20:58:21 +0000 (22:58 +0200)
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 <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24251
Signed-off-by: Robert Marko <robimarko@gmail.com>
include/kernel.mk

index 1f5104966203f69a22797b14d71a57c312af1957..146346a47538087a1933a1fc5b38e0bdb8787e06 100644 (file)
@@ -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))