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>