1
1
Commit Graph

1 Commits

Author SHA1 Message Date
Mark Mentovai
f5c5ccd236 kernel: fix gen_init_cpio build on macOS hosts
Kernel ae18b94099b0 (2025-08-20, in 6.18) introduced a dependency on the
Linux-specific O_LARGEFILE, and kernel 97169cd6d95b (2025-08-20, in
6.18) introduced a dependency on the Linux-specific copy_file_range.
Both of these commits were a part of the
https://lore.kernel.org/all/20250819032607.28727-1-ddiss@suse.de/
series. These new dependencies may not be available on non-Linux
systems, although it is possible to cross-build Linux on non-Linux build
hosts, and it is appropriate to run tools like gen_init_cpio on such
build hosts. It is straightforward to avoid these Linux-specific
features when not building on Linux.

This fixes:

  HOSTCC  usr/gen_init_cpio
usr/gen_init_cpio.c:460:16: error: call to undeclared
      function 'copy_file_range'; ISO C99 and later do not support implicit
      function declarations [-Wimplicit-function-declaration]
  460 |                         this_read = copy_file_range(file, NULL, outfd, N...
      |                                     ^
usr/gen_init_cpio.c:677:31: error: use of undeclared
      identifier 'O_LARGEFILE'
  677 |                                      O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC,
      |                                                           ^~~~~~~~~~~
2 errors generated.
gmake[7]: *** [scripts/Makefile.host:114: usr/gen_init_cpio] Error 1

Signed-off-by: Mark Mentovai <mark@mentovai.com>
Link: https://github.com/openwrt/openwrt/pull/23612
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-06-04 20:00:36 +02:00