From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 15BBD385840C; Tue, 14 Dec 2021 04:44:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15BBD385840C From: "syq at debian dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu Date: Tue, 14 Dec 2021 04:44:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: d X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: syq at debian dot org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw at gdcproject dot org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2021 04:44:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103604 --- Comment #12 from YunQiang Su --- (In reply to YunQiang Su from comment #11) > (In reply to Iain Buclaw from comment #10) > > (In reply to YunQiang Su from comment #6) > > >=20 > > > This patch can solve this problem: of course, we need to back port it= to > > > gcc-10/gcc-11 also. > > >=20 > > > The problem is due to that:=20 > > > N32 and N64 uses different "struct stat" > > > In the older version, __USE_FILE_OFFSET64 may be not defined for = N64 > > > while now, it is defined. > > Is this patch backwards compatible though? Perhaps the value of > > `__USE_FILE_OFFSET64` should instead be fixed to match that of the targ= et. >=20 > ohhh. you are right. I misunderstand this problem. There are no previous version at all..., since all of them are broken. And __USE_FILE_OFFSET64 for D is always defined (at least since it is intro= duce into gcc). So *stat64* function call should always be used, and stat.d has a wrong version. So the patch should be: Index: gcc-12-12-20211211/src/libphobos/libdruntime/core/sys/posix/sys/stat= .d =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc-12-12-20211211.orig/src/libphobos/libdruntime/core/sys/posix/sys/st= at.d +++ gcc-12-12-20211211/src/libphobos/libdruntime/core/sys/posix/sys/stat.d @@ -368,7 +368,7 @@ version (CRuntime_Glibc) } else { - c_long[3] st_pad2; + uint[3] st_pad2; c_long st_size; } static if (__USE_MISC || __USE_XOPEN2K8) @@ -402,7 +402,7 @@ version (CRuntime_Glibc) { c_long st_blocks; } - c_long[14] st_pad5; + uint[14] st_pad5; } } else version (PPC) This is the gdb ptype /o outputs: type =3D struct core.sys.posix.sys.stat.stat_t { ulong st_dev; int st_pad1[3]; ulong st_ino; uint st_mode; ulong st_nlink; uint st_uid; uint st_gid; ulong st_rdev; long st_pad2[3]; long st_size; long st_atime; ulong st_atimensec; long st_mtime; ulong st_mtimensec; long st_ctime; ulong st_ctimensec; long st_blksize; uint st_pad4; long st_blocks; long st_pad5[14]; } /* offset | size */ type =3D struct stat { /* 0 | 8 */ __dev_t st_dev; /* 8 | 12 */ int st_pad1[3]; /* XXX 4-byte hole */ /* 24 | 8 */ __ino64_t st_ino; /* 32 | 4 */ __mode_t st_mode; /* XXX 4-byte hole */ /* 40 | 8 */ __nlink_t st_nlink; /* 48 | 4 */ __uid_t st_uid; /* 52 | 4 */ __gid_t st_gid; /* 56 | 8 */ __dev_t st_rdev; /* 64 | 12 */ unsigned int st_pad2[3]; /* XXX 4-byte hole */ /* 80 | 8 */ __off64_t st_size; /* 88 | 16 */ struct timespec { /* 88 | 8 */ __time_t tv_sec; /* 96 | 8 */ __syscall_slong_t tv_nsec; /* total size (bytes): 16 */ } st_atim; /* 104 | 16 */ struct timespec { /* 104 | 8 */ __time_t tv_sec; /* 112 | 8 */ __syscall_slong_t tv_nsec; /* total size (bytes): 16 */ } st_mtim; /* 120 | 16 */ struct timespec { /* 120 | 8 */ __time_t tv_sec; /* 128 | 8 */ __syscall_slong_t tv_nsec; /* total size (bytes): 16 */ } st_ctim; /* 136 | 8 */ __blksize_t st_blksize; /* 144 | 4 */ unsigned int st_pad4; /* XXX 4-byte hole */ /* 152 | 8 */ __blkcnt64_t st_blocks; /* 160 | 56 */ int st_pad5[14]; /* total size (bytes): 216 */ }=