From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E6C013858D37; Wed, 28 Jun 2023 17:23:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6C013858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687972990; bh=Wq5+r9OlzFznsG/k958QcO6/0KoFd8P2UV4sKnzG3JM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iqhKS1tHq9L1k5BrS65usUFuljnJGuKZ35Y/o2D6qgyiv5VpmwkSQuA8r5ZoMz3I0 iOa+WVpxDn0suXQleka6OJmLW+FQWMzBTUwDTmuDxdig8/SKGd7bff48NzdBPO250o BnFYkR1SR8SV4d1/evOiiGrRCI8LkaUWrMr3NIL0= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110462] [14 regression] Build failure with musl-1.2.4 (filesystem/ops-common.h:377:5: error: 'off64_t' was not declared in this scope; did you mean 'off_t'?) Date: Wed, 28 Jun 2023 17:23:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to target_milestone everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110462 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2023-06-28 Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu= .org Target Milestone|--- |14.0 Ever confirmed|0 |1 --- Comment #8 from Jonathan Wakely --- (In reply to Sam James from comment #3) > Looks like we already AC_SYS_LARGEFILE in libstdc++-v3/configure.ac, so t= his > should be as simple as just using off_t instead? Ah but the filesystem sources include which means off_t is 64-bit here. I'll test this: diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index efc27aa493e..43dd80abc15 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -5160,7 +5160,7 @@ dnl linux*) GCC_TRY_COMPILE_OR_LINK( [#include ], - [copy_file_range(1, nullptr, 2, nullptr, 1, 0);], + [copy_file_range(1, (off_t*)nullptr, 2, (off_t*)nullptr, 1, 0);], [glibcxx_cv_copy_file_range=3Dyes], [glibcxx_cv_copy_file_range=3Dno]) ;; diff --git a/libstdc++-v3/src/filesystem/ops-common.h b/libstdc++-v3/src/filesystem/ops-common.h index f04bbc66d7d..e04cb4010d7 100644 --- a/libstdc++-v3/src/filesystem/ops-common.h +++ b/libstdc++-v3/src/filesystem/ops-common.h @@ -374,7 +374,9 @@ _GLIBCXX_BEGIN_NAMESPACE_FILESYSTEM return false; } size_t bytes_left =3D length; - off64_t off_in =3D 0, off_out =3D 0; + // copy_file_range wants off64_t* args, but libc might only define off= _t. + static_assert(sizeof(off_t) =3D=3D sizeof(int64_t), "off_t is 64-bit"); + off_t off_in =3D 0, off_out =3D 0; ssize_t bytes_copied; do {=