]> git.ipfire.org Git - thirdparty/openwrt.git/commit
kernel: fix objtool build on macOS hosts
authorMark Mentovai <mark@mentovai.com>
Mon, 1 Jun 2026 13:16:59 +0000 (09:16 -0400)
committerRobert Marko <robimarko@gmail.com>
Thu, 4 Jun 2026 18:00:36 +0000 (20:00 +0200)
commitb0d2cee3ea070461dd147bbe4f5f49e3e0e7e138
tree564bebceed972e70703f048ee601b26fcb91bdeb
parente288f421f846ff2c8bb7fd16f678447aacd0ec57
kernel: fix objtool build on macOS hosts

Since kernel 5a406031d0719 (2025-03-17, in 6.15), objtool calls
sendfile, but sendfile is Linux-specific and a sendfile with the
requisite capabilities is not available on other operating systems.
Provide a more portable fallback implementation to be used when
cross-building on non-Linux hosts.

This fixes:

  CC      …/linux-6.18.33/tools/objtool/builtin-check.o
builtin-check.c:13:10: fatal error: 'sys/sendfile.h' file
      not found
   13 | #include <sys/sendfile.h>
      |          ^~~~~~~~~~~~~~~~
1 error generated.
gmake[8]: *** […/linux-6.18.33/tools/build/Makefile.build:86: …/linux-6.18.33/tools/objtool/builtin-check.o] Error 1

Fixes: https://github.com/openwrt/openwrt/issues/23356
Signed-off-by: Mark Mentovai <mark@mentovai.com>
Link: https://github.com/openwrt/openwrt/pull/23612
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/generic/hack-6.18/202-objtool_portability.patch [new file with mode: 0644]