# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/wasi-libcxx/hotfix-wasi-no-copy-file-range.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- wasi-libc is musl-derived, so _LIBCPP_HAS_MUSL_LIBC makes libc++ assume copy_file_range() is available, but WASI has no such syscall and wasi-libc guards the declaration out. Exclude WASI so the filesystem code falls back to the fstream copy implementation. Signed-off-by: René Rebe --- ./libcxx/src/filesystem/operations.cpp.vanilla 2026-08-30 14:38:40.000000000 +0200 +++ ./libcxx/src/filesystem/operations.cpp 2026-08-30 14:38:40.000000000 +0200 @@ -41,7 +41,7 @@ #include // since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc >= 2.27 and musl -#if _LIBCPP_GLIBC_PREREQ(2, 27) || _LIBCPP_HAS_MUSL_LIBC || defined(__FreeBSD__) +#if (_LIBCPP_GLIBC_PREREQ(2, 27) || _LIBCPP_HAS_MUSL_LIBC || defined(__FreeBSD__)) && !defined(__wasi__) # define _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE #endif