1
1
openwrt/target/linux/generic
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
..
backport-6.12 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
backport-6.18 kernel: bump 6.18 to 6.18.34 2026-06-02 21:14:04 +02:00
files ar8216: use devm for mdiobus consistently 2026-05-25 00:36:10 +02:00
files-6.12/drivers/net/phy/rtl8261n generic: 6.18: drop downstream RTL8261N driver 2026-05-21 17:04:55 +01:00
hack-6.12 kernel: bump 6.12 to 6.12.91 2026-05-25 21:02:13 +02:00
hack-6.18 kernel: fix gen_init_cpio build on macOS hosts 2026-06-04 20:00:36 +02:00
image treewide: strip trailing whitespace 2025-05-20 00:47:37 +02:00
other-files initramfs: switch to tmpfs to fix ujail 2020-11-27 01:23:43 +00:00
pending-6.12 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
pending-6.18 airoha: cpufreq: fix function signature 2026-06-03 09:06:34 +02:00
config-6.12 generic: add DWMAC_QCOM_ETHQOS 2026-05-19 11:25:38 +02:00
config-6.18 generic: add missing config symbols for 6.18 2026-06-03 09:06:31 +02:00
config-filter generic: filter: add RUSTC symbols 2026-04-22 16:46:44 +02:00
kernel-6.12 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
kernel-6.18 kernel: bump 6.18 to 6.18.34 2026-06-02 21:14:04 +02:00
PATCHES.md generic: improve patches documentation 2025-06-11 15:09:46 +02:00