1
1

Compare commits

...

10 Commits

Author SHA1 Message Date
Karsten Sperling
28fa9c7540 build: fix recipe line break in wrap_mirror fallback path
Some checks failed
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Commit 042996b46b ("build: stricter hash validation on download")
refactored the $(if) in wrap_mirror from a single line to multiple lines.
The else branch (used when MIRROR is empty) was moved to a new line without
a trailing backslash on the preceding line. This causes download methods
that use wrap_mirror (e.g. git) to fail when PKG_SOURCE_MIRROR is 0:

    SHELL= flock ...flock -c '  ...
    bash: -c: line 1: unexpected EOF while looking for matching `''

The fix is to add the missing \ to the else branch.

Signed-off-by: Karsten Sperling <ksperling@apple.com>
2026-06-04 21:12:27 +02:00
Dustin Lundquist
f93228427a toolchain/gcc: backport libsanitizer struct termio fix for glibc 2.43
glibc 2.43 no longer exposes struct termio (the old UNIX System V
terminal struct) through <termios.h>. This breaks the GCC 14
libsanitizer build which uses sizeof(struct termio) and registers
ioctl interceptors for the legacy TCGETA/TCSETA/TCSETAF/TCSETAW
ioctls that operated on struct termio.

GCC 15 already dropped these references. Backport that removal to
the GCC 14 patch series.

Signed-off-by: Dustin Lundquist <dustin@null-ptr.net>
2026-06-04 20:06:32 +02:00
Mark Mentovai
b3601af4e4 kernel: don't disable stack validation in cross builds
c3e31b6a9b (2019-07-03), 5f8e587240 (2019-10-02), and 802bfe0806
(2022-10-20) disabled kernel stack validation when the build host was
not running Linux, as the objtool kernel build tool required for stack
validation was not portable to other build host environments. This is no
longer true, and it is not necessary to attempt to disable kernel stack
validation any longer.

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
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
Mark Mentovai
b0d2cee3ea 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>
2026-06-04 20:00:36 +02:00
Seo Suchan
e288f421f8
libmd: update to 1.2.0
this brings sha3 and black support into it.

90c4f43 Release libmd 1.2.0
fc4f75a build: Set TAR_OPTIONS to avoid leaking maintainer information on dist
36d829e build: Request tar-ustar format for distribution
c1b3bff Remove spurious blank lines at the beginning of functions
0ae00e2 Fix and hook SHA3 and SHAKE support
2c0d2f0 Add internal endian conversion functions support
3bb8921 Add internal explicit_bzero() support
4442c4b Add SHA3 and SHAKE support
7b740a6 doc: Move derived code attribution to a Comment field
bb5a08e doc: Remove redundant «Copyright ©» prefix from Copyright field in COPYING
9b03479 build: Add Maintainer and License fields to the .pc file
8fffa5f doc: Remove «All rights reserved» from COPYING
d5b8e85 build: Rename LIBMD_ABI to SOVERSION
ea62163 build: Add a coverage regex to the CI job
7e32142 man: Sync SHA2 changes from OpenBSD
488d585 build: Add a new vpath-tests CI test
b49ee25 build: Refactor autogen call into before_script
137dd4e build: Fix out-of-tree build

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23643
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-04 09:59:32 +02:00
Seo Suchan
43ee70c53f
libxml2: update to 2.15.3
Update to latest release. new maintainer upstream didn't make changelog, so see https://gitlab.gnome.org/GNOME/libxml2/-/commits/2.15?ref_type=heads for commits betwwen 2.15.1 and 2.15.3

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23642
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-04 09:49:44 +02:00
Shiji Yang
c82f2724f5
uboot-imx: do not build efimkcapsule tool
This tool requires gnutls. In fact, we do not have to build it.
Fix build error:

tools/mkeficapsule.c:20:10: fatal error: gnutls/gnutls.h: No such file or directory
   20 | #include <gnutls/gnutls.h>
      |          ^~~~~~~~~~~~~~~~~

Fixes: 158651a6d7 ("uboot-imx: bump to 2026.04 release")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/23635
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-04 00:47:20 +02:00
Pavlo Samko
84f4f77920
nilfs-utils: update to 2.3.0
Changelog: https://nilfs.sourceforge.io/download/ChangeLog-utils-v2

Signed-off-by: Pavlo Samko <bulldozerbsg@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21932
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-03 13:46:09 +02:00
John Crispin
5526366fea unetd: cli: convey network name from inviter to joiner
The unet CLI's join handler used the joiner's --network value as the
local network name, so an unspecified --network fell back to the
literal 'unet'. The inviter typically uses a different name (e.g.
ucoord_<venue>), so the two sides ended up keyed differently and any
upper layer subscribing to the network-named unetmsg channel never
saw each other.

The inviter now passes enroll_info={ network } to enroll_start so
the inviter's network name rides along in enroll_meta. The joiner
prefers data.enroll_meta?.network when present, falling back to its
own --network value for backwards compatibility with older inviters.

Signed-off-by: John Crispin <john@phrozen.org>
2026-06-03 11:19:06 +00:00
11 changed files with 219 additions and 34 deletions

View File

@ -161,7 +161,7 @@ $(if $(if $(MIRROR), \
echo "Hash mismatch for file $(FILE): expected $(MIRROR_HASH), got $$$$file_hash"; \ echo "Hash mismatch for file $(FILE): expected $(MIRROR_HASH), got $$$$file_hash"; \
false; \ false; \
}; \ }; \
)), )), \
$(3)) \ $(3)) \
$(if $(filter check,$(1)), \ $(if $(filter check,$(1)), \
$(call check_hash,$(FILE),$(MIRROR_HASH),$(2)MIRROR_$(call hash_var,$(MIRROR_MD5SUM))) \ $(call check_hash,$(FILE),$(MIRROR_HASH),$(2)MIRROR_$(call hash_var,$(MIRROR_MD5SUM))) \

View File

@ -129,11 +129,6 @@ ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL
KERNELRELEASE=$(LINUX_VERSION) KERNELRELEASE=$(LINUX_VERSION)
endif endif
ifneq ($(HOST_OS),Linux)
KERNEL_MAKE_FLAGS += CONFIG_STACK_VALIDATION=
export SKIP_STACK_VALIDATION:=1
endif
KERNEL_MAKEOPTS = -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS) KERNEL_MAKEOPTS = -C $(LINUX_DIR) $(KERNEL_MAKE_FLAGS)
ifdef CONFIG_USE_SPARSE ifdef CONFIG_USE_SPARSE

View File

@ -59,6 +59,9 @@ define U-Boot/wandboard
BUILD_DEVICES:=wandboard_dual BUILD_DEVICES:=wandboard_dual
endef endef
UBOOT_CUSTOMIZE_CONFIG := \
--disable TOOLS_MKEFICAPSULE
UBOOT_TARGETS := \ UBOOT_TARGETS := \
apalis_imx6 \ apalis_imx6 \
kontron-osm-s-mx8mp \ kontron-osm-s-mx8mp \

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=libmd PKG_NAME:=libmd
PKG_VERSION:=1.1.0 PKG_VERSION:=1.2.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://archive.hadrons.org/software/libmd/ PKG_SOURCE_URL:=https://archive.hadrons.org/software/libmd/
PKG_HASH:=1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332 PKG_HASH:=ac15ffb8430502fbaccdec66c5a82ee0eab0b0f36220df56710feadfeb13d0a0
PKG_LICENSE:=BSD-3-Clause PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING PKG_LICENSE_FILES:=COPYING

View File

@ -1,12 +1,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=libxml2 PKG_NAME:=libxml2
PKG_VERSION:=2.15.1 PKG_VERSION:=2.15.3
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION)) PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION))
PKG_HASH:=c008bac08fd5c7b4a87f7b8a71f283fa581d80d80ff8d2efd3b26224c39bc54c PKG_HASH:=78262a6e7ac170d6528ebfe2efccdf220191a5af6a6cd61ea4a9a9a5042c7a07
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=Copyright PKG_LICENSE_FILES:=Copyright

View File

@ -8,6 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=unetd PKG_NAME:=unetd
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git
PKG_SOURCE_DATE:=2026-05-22 PKG_SOURCE_DATE:=2026-05-22

View File

@ -586,6 +586,7 @@ function network_invite(ctx, argv, named)
let req = { let req = {
network, network,
timeout: named.timeout, timeout: named.timeout,
enroll_info: { network },
}; };
if (named["access-key"]) { if (named["access-key"]) {
@ -606,12 +607,13 @@ function network_invite(ctx, argv, named)
function network_join_peer_update(model, ctx, msg) function network_join_peer_update(model, ctx, msg)
{ {
let joinreq = ctx.data.enroll; let joinreq = ctx.data.enroll;
let name = joinreq.name;
let data = network_handle_enroll_update(model, ctx, msg); let data = network_handle_enroll_update(model, ctx, msg);
if (!data) if (!data)
return; return;
let name = data.enroll_meta?.network ?? joinreq.name;
let iface = { let iface = {
proto: "unet", proto: "unet",
metric: joinreq.metric, metric: joinreq.metric,

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=nilfs-utils PKG_NAME:=nilfs-utils
PKG_VERSION:=2.2.12 PKG_VERSION:=2.3.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_URL:=https://nilfs.sourceforge.io PKG_URL:=https://nilfs.sourceforge.io
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://nilfs.sourceforge.io/download/ PKG_SOURCE_URL:=https://nilfs.sourceforge.io/download/
PKG_HASH:=fc9a8520b68928d43fffa465c3b3845cc9b7d4973f4fbde4b3c7ecf25ce52d09 PKG_HASH:=c0876a7ecd13d4b54cb65abb9ad6cd0bf1ed102d03ca12738f12eab9bd84e67b
PKG_MAINTAINER:=Pavlo Samko <bulldozerbsg@gmail.com> PKG_MAINTAINER:=Pavlo Samko <bulldozerbsg@gmail.com>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
@ -63,19 +63,12 @@ define Package/libnilfsgc
DEPENDS:=+libnilfs DEPENDS:=+libnilfs
endef endef
define Package/libnilfscleaner
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libnilfscleaner
DEPENDS:=+libuuid +nilfs-cleanerd @KERNEL_POSIX_MQUEUE
endef
define Package/nilfs-clean define Package/nilfs-clean
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
SUBMENU:=Filesystem SUBMENU:=Filesystem
TITLE:=run garbage collector on NILFS file system TITLE:=run garbage collector on NILFS file system
DEPENDS:=+libnilfs +libnilfscleaner DEPENDS:=+libuuid +libnilfs @KERNEL_POSIX_MQUEUE
endef endef
define Package/nilfs-resize define Package/nilfs-resize
@ -121,25 +114,26 @@ endef
# libmount is used and support of the selinux context mount options # libmount is used and support of the selinux context mount options
# depends on the libmount that distro provides. # depends on the libmount that distro provides.
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--enable-usrmerge \
--without-selinux --without-selinux
define Package/nilfs-mkfs/install define Package/nilfs-mkfs/install
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.nilfs2 $(1)/sbin/ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.nilfs2 $(1)/usr/sbin/
endef endef
define Package/nilfs-cleanerd/install define Package/nilfs-cleanerd/install
$(INSTALL_DIR) $(1)/etc $(INSTALL_DIR) $(1)/etc
$(CP) $(PKG_INSTALL_DIR)/etc/nilfs_cleanerd.conf $(1)/etc/ $(CP) $(PKG_INSTALL_DIR)/etc/nilfs_cleanerd.conf $(1)/etc/
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/sbin/nilfs_cleanerd $(1)/sbin/ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/nilfs_cleanerd $(1)/usr/sbin/
endef endef
define Package/nilfs-mount/install define Package/nilfs-mount/install
$(INSTALL_DIR) $(1)/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/sbin/mount.nilfs2 $(1)/sbin/ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/mount.nilfs2 $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/sbin/umount.nilfs2 $(1)/sbin/ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/umount.nilfs2 $(1)/usr/sbin/
endef endef
define Package/libnilfs/install define Package/libnilfs/install
@ -152,11 +146,6 @@ define Package/libnilfsgc/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnilfsgc.so* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnilfsgc.so* $(1)/usr/lib/
endef endef
define Package/libnilfscleaner/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libnilfscleaner.so* $(1)/usr/lib/
endef
define Package/nilfs-clean/install define Package/nilfs-clean/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/nilfs-clean $(1)/usr/sbin/ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/nilfs-clean $(1)/usr/sbin/
@ -195,7 +184,6 @@ $(eval $(call BuildPackage,nilfs-cleanerd))
$(eval $(call BuildPackage,nilfs-mount)) $(eval $(call BuildPackage,nilfs-mount))
$(eval $(call BuildPackage,libnilfs)) $(eval $(call BuildPackage,libnilfs))
$(eval $(call BuildPackage,libnilfsgc)) $(eval $(call BuildPackage,libnilfsgc))
$(eval $(call BuildPackage,libnilfscleaner))
$(eval $(call BuildPackage,nilfs-clean)) $(eval $(call BuildPackage,nilfs-clean))
$(eval $(call BuildPackage,nilfs-resize)) $(eval $(call BuildPackage,nilfs-resize))
$(eval $(call BuildPackage,nilfs-tune)) $(eval $(call BuildPackage,nilfs-tune))

View File

@ -0,0 +1,52 @@
From 60e044199e773df4863405dba0f7abe16a43282d Mon Sep 17 00:00:00 2001
From: Mark Mentovai <mark@mentovai.com>
Date: Fri, 29 May 2026 12:48:31 -0400
Subject: [PATCH] gen_init_cpio: fix build on macOS hosts
ae18b94099b0 (2025-08-20, in 6.18) introduced a dependency on the
Linux-specific O_LARGEFILE, and 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.
Signed-off-by: Mark Mentovai <mark@mentovai.com>
---
usr/gen_init_cpio.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -456,6 +456,7 @@ static int cpio_mkfile(const char *name,
push_pad(namepadlen ? namepadlen : padlen(offset, 4)) < 0)
goto error;
+#ifdef __linux__
if (size) {
this_read = copy_file_range(file, NULL, outfd, NULL, size, 0);
if (this_read > 0) {
@@ -466,6 +467,7 @@ static int cpio_mkfile(const char *name,
}
/* short or failed copy falls back to read/write... */
}
+#endif
while (size) {
unsigned char filebuf[65536];
@@ -674,7 +676,11 @@ int main (int argc, char *argv[])
break;
case 'o':
outfd = open(optarg,
- O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC,
+ O_WRONLY | O_CREAT | O_TRUNC
+#ifdef O_LARGEFILE
+ | O_LARGEFILE
+#endif
+ ,
0600);
if (outfd < 0) {
fprintf(stderr, "failed to open %s\n", optarg);

View File

@ -0,0 +1,91 @@
From dc5565c4478135999d8bb193bd9dfb4f8ef5f96b Mon Sep 17 00:00:00 2001
From: Mark Mentovai <mark@mentovai.com>
Date: Mon, 1 Jun 2026 09:11:43 -0400
Subject: [PATCH] objtool: fix build on macOS hosts
Since 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.
Signed-off-by: Mark Mentovai <mark@mentovai.com>
---
tools/objtool/builtin-check.c | 40 +++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -10,7 +10,9 @@
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
+#ifdef __linux__
#include <sys/sendfile.h>
+#endif
#include <objtool/builtin.h>
#include <objtool/objtool.h>
#include <objtool/warn.h>
@@ -187,12 +189,28 @@ static bool opts_valid(void)
return false;
}
+#ifndef __linux__
+#define RETRY_EINTR(x) \
+ ({ \
+ __typeof__(x) eintr_wrapper_result; \
+ do { \
+ eintr_wrapper_result = (x); \
+ } while (eintr_wrapper_result == -1 && errno == EINTR); \
+ eintr_wrapper_result; \
+ })
+#endif
+
static int copy_file(const char *src, const char *dst)
{
size_t to_copy, copied;
int dst_fd, src_fd;
struct stat stat;
+#ifdef __linux__
off_t offset = 0;
+#else
+ char buf[65536];
+ ssize_t nread, nwrote;
+#endif
src_fd = open(src, O_RDONLY);
if (src_fd == -1) {
@@ -217,11 +235,33 @@ static int copy_file(const char *src, co
}
for (to_copy = stat.st_size; to_copy > 0; to_copy -= copied) {
+#ifdef __linux__
copied = sendfile(dst_fd, src_fd, &offset, to_copy);
if (copied == -1) {
ERROR_GLIBC("sendfile");
return 1;
}
+#else
+ nread = RETRY_EINTR(
+ read(src_fd, buf,
+ to_copy < sizeof(buf) ? to_copy : sizeof(buf)));
+ if (nread < 0) {
+ ERROR_GLIBC("read");
+ return 1;
+ }
+ if (nread == 0) {
+ ERROR("unexpected premature EOF");
+ return 1;
+ }
+ for (copied = 0; copied < nread; copied += nwrote) {
+ nwrote = RETRY_EINTR(
+ write(dst_fd, buf + copied, nread - copied));
+ if (nwrote < 0) {
+ ERROR_GLIBC("write");
+ return 1;
+ }
+ }
+#endif
}
close(dst_fd);

View File

@ -0,0 +1,53 @@
From: Backport from GCC 15
libsanitizer: remove struct termio and legacy ioctl interceptors for glibc
glibc 2.43 no longer exposes struct termio (the old UNIX System V
terminal struct) through <termios.h>. The old TCGETA/TCSETA/TCSETAF/
TCSETAW ioctls that operated on struct termio are legacy interfaces
superseded by the POSIX TCGETS/TCSETS family using struct termios.
GCC 15 already dropped these; this patch backports that removal to GCC 14.
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -479,9 +479,6 @@
unsigned struct_input_id_sz = sizeof(struct input_id);
unsigned struct_mtpos_sz = sizeof(struct mtpos);
unsigned struct_rtentry_sz = sizeof(struct rtentry);
-#if SANITIZER_GLIBC || SANITIZER_ANDROID
- unsigned struct_termio_sz = sizeof(struct termio);
-#endif
unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
unsigned struct_vt_stat_sz = sizeof(struct vt_stat);
--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -1012,7 +1012,6 @@
extern unsigned struct_input_absinfo_sz;
extern unsigned struct_input_id_sz;
extern unsigned struct_mtpos_sz;
-extern unsigned struct_termio_sz;
extern unsigned struct_vt_consize_sz;
extern unsigned struct_vt_sizes_sz;
extern unsigned struct_vt_stat_sz;
--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -338,17 +338,9 @@
_(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
_(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
_(TCFLSH, NONE, 0);
-#if SANITIZER_GLIBC
- _(TCGETA, WRITE, struct_termio_sz);
-#endif
_(TCGETS, WRITE, struct_termios_sz);
_(TCSBRK, NONE, 0);
_(TCSBRKP, NONE, 0);
-#if SANITIZER_GLIBC
- _(TCSETA, READ, struct_termio_sz);
- _(TCSETAF, READ, struct_termio_sz);
- _(TCSETAW, READ, struct_termio_sz);
-#endif
_(TCSETS, READ, struct_termios_sz);
_(TCSETSF, READ, struct_termios_sz);
_(TCSETSW, READ, struct_termios_sz);