[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #26 from YunQiang Su --- (In reply to Iain Buclaw from comment #25) > Fixed layout has been pushed out, should be all good now. (In reply to YunQiang Su from comment #19) > (In reply to Iain Buclaw from comment #18) > > (In reply to Iain Buclaw from comment #16) > > > (In reply to Iain Buclaw from comment #15) > > > > Don't think it would fail now the statically allocated size is *at > > > > least* > > > > same as C. But some alias is still not matching up. > > > core.sys.posix.sys.types is implicitly assuming X86 sizes. > > > > (In reply to Iain Buclaw from comment #15) > > > Created attachment 51999 [details] > > > mips stat_t patch > > > > > > Patch matches field declarations I can see in the headers, and it for sure > > > reigns it in. > > > > > > | C | D | > > > 32 | 144 | 160 | > > > o64 | 160 | 176 | > > > n32 | 160 | 176 | > > > 64 | 216 | 216 | > > > > > > Don't think it would fail now the statically allocated size is *at least* > > > same as C. But some alias is still not matching up. > > Ah, no, this is right, I just didn't build the C source with > > -D_FILE_OFFSET_BITS=64 > > FYI: I find that gcc/glibc (for C) generates wrong code for O32 with > -D_FILE_OFFSET_BITS=64. > > I am digging it. mipsel has no problem: I should use %lld to print the st_size.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 Iain Buclaw changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #25 from Iain Buclaw --- Fixed layout has been pushed out, should be all good now.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #24 from CVS Commits --- The releases/gcc-9 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:38d8dec9c9d6a735759ddebe6d90a50719a7f94c commit r9-9881-g38d8dec9c9d6a735759ddebe6d90a50719a7f94c Author: Iain Buclaw Date: Tue Dec 21 14:07:37 2021 +0100 libphobos: Fix definition of stat_t for MIPS64 (PR103604) Backported specific change from commit r12-6003. libphobos/ChangeLog: PR d/103604 * libdruntime/core/sys/posix/sys/stat.d (struct stat_t): Fix definition for MIPS64. (cherry picked from commit 96a09dec2421af3e201f5a54dadb35f00917ea5b)
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #23 from CVS Commits --- The releases/gcc-10 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:ecd9684ec16ec0de2e4c0bb3f2097f98e6686cbe commit r10-10354-gecd9684ec16ec0de2e4c0bb3f2097f98e6686cbe Author: Iain Buclaw Date: Tue Dec 21 14:07:37 2021 +0100 libphobos: Fix definition of stat_t for MIPS64 (PR103604) Backported specific change from commit r12-6003. libphobos/ChangeLog: PR d/103604 * libdruntime/core/sys/posix/sys/stat.d (struct stat_t): Fix definition for MIPS64. (cherry picked from commit 96a09dec2421af3e201f5a54dadb35f00917ea5b)
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #22 from CVS Commits --- The releases/gcc-11 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:96a09dec2421af3e201f5a54dadb35f00917ea5b commit r11-9408-g96a09dec2421af3e201f5a54dadb35f00917ea5b Author: Iain Buclaw Date: Tue Dec 21 14:07:37 2021 +0100 libphobos: Fix definition of stat_t for MIPS64 (PR103604) Backported specific change from commit r12-6003. libphobos/ChangeLog: PR d/103604 * libdruntime/core/sys/posix/sys/stat.d (struct stat_t): Fix definition for MIPS64.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #21 from CVS Commits --- The master branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:fd43568cc54e17c8b4a845677872c6282bc6dbb7 commit r12-6003-gfd43568cc54e17c8b4a845677872c6282bc6dbb7 Author: Iain Buclaw Date: Wed Dec 15 19:47:02 2021 +0100 d: Merge upstream dmd 93108bb9e, druntime 6364e010, phobos 575b67a9b. D front-end changes: - Import dmd v2.098.1-beta.1. - Default extern(C++) compatibility to C++17. Druntime changes: - Import druntime v2.098.1-beta.1. - Fix definition of stat_t on MIPS64 (PR103604) Phobos changes: - Import phobos v2.098.1-beta.1. gcc/d/ChangeLog: * d-lang.cc (d_init_options): Set default -fextern-std= to C++17. * dmd/MERGE: Merge upstream dmd 93108bb9e. * gdc.texi (Runtime Options): Document the default for -fextern-std=. libphobos/ChangeLog: PR d/103604 * configure: Regenerate. * configure.ac (libtool_VERSION): Update to 3:0:0. * libdruntime/MERGE: Merge upstream druntime 6364e010. * src/MERGE: Merge upstream phobos 575b67a9b. * testsuite/libphobos.traits/all_satisfy.d: New test. * testsuite/libphobos.traits/traits.exp: New test.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #20 from Iain Buclaw --- (In reply to YunQiang Su from comment #17) > (In reply to Iain Buclaw from comment #16) > > (In reply to Iain Buclaw from comment #15) > > > Don't think it would fail now the statically allocated size is *at least* > > > same as C. But some alias is still not matching up. > > core.sys.posix.sys.types is implicitly assuming X86 sizes. > > (In reply to YunQiang Su from comment #13) > > And please have a wait, I need to make sure that this patch can work with > > N32. > > Finally, with help of gdb, This patch can work with both N64 and N32. Thanks, I've gone with a variant of what I submitted here. Added a few static asserts to ensure that the size matches what I've observed. https://github.com/dlang/druntime/pull/3649
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #19 from YunQiang Su --- (In reply to Iain Buclaw from comment #18) > (In reply to Iain Buclaw from comment #16) > > (In reply to Iain Buclaw from comment #15) > > > Don't think it would fail now the statically allocated size is *at least* > > > same as C. But some alias is still not matching up. > > core.sys.posix.sys.types is implicitly assuming X86 sizes. > > (In reply to Iain Buclaw from comment #15) > > Created attachment 51999 [details] > > mips stat_t patch > > > > Patch matches field declarations I can see in the headers, and it for sure > > reigns it in. > > > > | C | D | > > 32 | 144 | 160 | > > o64 | 160 | 176 | > > n32 | 160 | 176 | > > 64 | 216 | 216 | > > > > Don't think it would fail now the statically allocated size is *at least* > > same as C. But some alias is still not matching up. > Ah, no, this is right, I just didn't build the C source with > -D_FILE_OFFSET_BITS=64 FYI: I find that gcc/glibc (for C) generates wrong code for O32 with -D_FILE_OFFSET_BITS=64. I am digging it.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #18 from Iain Buclaw --- (In reply to Iain Buclaw from comment #16) > (In reply to Iain Buclaw from comment #15) > > Don't think it would fail now the statically allocated size is *at least* > > same as C. But some alias is still not matching up. > core.sys.posix.sys.types is implicitly assuming X86 sizes. (In reply to Iain Buclaw from comment #15) > Created attachment 51999 [details] > mips stat_t patch > > Patch matches field declarations I can see in the headers, and it for sure > reigns it in. > > | C | D | > 32 | 144 | 160 | > o64 | 160 | 176 | > n32 | 160 | 176 | > 64 | 216 | 216 | > > Don't think it would fail now the statically allocated size is *at least* > same as C. But some alias is still not matching up. Ah, no, this is right, I just didn't build the C source with -D_FILE_OFFSET_BITS=64
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #17 from YunQiang Su --- (In reply to Iain Buclaw from comment #16) > (In reply to Iain Buclaw from comment #15) > > Don't think it would fail now the statically allocated size is *at least* > > same as C. But some alias is still not matching up. > core.sys.posix.sys.types is implicitly assuming X86 sizes. (In reply to YunQiang Su from comment #13) > And please have a wait, I need to make sure that this patch can work with > N32. Finally, with help of gdb, This patch can work with both N64 and N32. --- /usr/lib/gcc/mips64el-linux-gnuabi64/11/include/d/core/sys/posix/sys/stat.d 2021-11-18 20:24:46.0 + +++ stat.d 2021-12-14 15:22:21.929556158 + @@ -345,7 +345,7 @@ { struct stat_t { -c_ulong st_dev; +ulong st_dev; int[3] st_pad1; static if (!__USE_FILE_OFFSET64) { @@ -353,13 +353,13 @@ } else { -c_ulong st_ino; +ulong st_ino; } mode_t st_mode; nlink_t st_nlink; uid_t st_uid; gid_t st_gid; -c_ulong st_rdev; +ulong st_rdev; static if (!__USE_FILE_OFFSET64) { uint[2] st_pad2; @@ -368,8 +368,8 @@ } else { -c_long[3] st_pad2; -c_long st_size; +uint[3] st_pad2; +longst_size; } static if (__USE_MISC || __USE_XOPEN2K8) { @@ -400,9 +400,9 @@ } else { -c_long st_blocks; +longst_blocks; } -c_long[14] st_pad5; +uint[14] st_pad5; } } else version (PPC)
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #16 from Iain Buclaw --- (In reply to Iain Buclaw from comment #15) > Don't think it would fail now the statically allocated size is *at least* > same as C. But some alias is still not matching up. core.sys.posix.sys.types is implicitly assuming X86 sizes.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #15 from Iain Buclaw --- Created attachment 51999 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51999=edit mips stat_t patch Patch matches field declarations I can see in the headers, and it for sure reigns it in. | C | D | 32 | 144 | 160 | o64 | 160 | 176 | n32 | 160 | 176 | 64 | 216 | 216 | Don't think it would fail now the statically allocated size is *at least* same as C. But some alias is still not matching up.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #14 from Iain Buclaw --- (In reply to YunQiang Su from comment #13) > And please have a wait, I need to make sure that this patch can work with > N32. So on gcc230, what I see is: | C | D | 32 | 144 | 160 | o64 | 160 | 148 | n32 | 160 | 148 | 64 | 216 | 280 | Totally wrong across the board.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #13 from YunQiang Su --- And please have a wait, I need to make sure that this patch can work with N32.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- 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) > > > > > > This patch can solve this problem: of course, we need to back port it to > > > gcc-10/gcc-11 also. > > > > > > The problem is due to that: > > > 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 target. > > 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 introduce 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 === --- gcc-12-12-20211211.orig/src/libphobos/libdruntime/core/sys/posix/sys/stat.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 = 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 = 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 */ }
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #11 from YunQiang Su --- (In reply to Iain Buclaw from comment #10) > (In reply to YunQiang Su from comment #6) > > > > This patch can solve this problem: of course, we need to back port it to > > gcc-10/gcc-11 also. > > > > The problem is due to that: > > 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 target. ohhh. you are right. I misunderstand this problem.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #10 from Iain Buclaw --- (In reply to YunQiang Su from comment #6) > > This patch can solve this problem: of course, we need to back port it to > gcc-10/gcc-11 also. > > The problem is due to that: > 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 target.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #9 from YunQiang Su --- (In reply to ibuclaw from comment #8) > (In reply to YunQiang Su from comment #7) > > Where should we fallback this patch to? > I can submit it to upstream dlang/druntime (on github) and merged it in when > I next do the sync later this week. Thank you so much.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 ibuclaw at gcc dot gnu.org changed: What|Removed |Added Status|WAITING |ASSIGNED --- Comment #8 from ibuclaw at gcc dot gnu.org --- (In reply to YunQiang Su from comment #7) > Where should we fallback this patch to? I can submit it to upstream dlang/druntime (on github) and merged it in when I next do the sync later this week.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #7 from YunQiang Su --- Where should we fallback this patch to?
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #6 from YunQiang Su --- Index: gcc-12-12-20211211/src/libphobos/libdruntime/core/sys/posix/sys/stat.d === --- gcc-12-12-20211211.orig/src/libphobos/libdruntime/core/sys/posix/sys/stat.d +++ gcc-12-12-20211211/src/libphobos/libdruntime/core/sys/posix/sys/stat.d @@ -347,7 +347,7 @@ version (CRuntime_Glibc) { c_ulong st_dev; int[3] st_pad1; -static if (!__USE_FILE_OFFSET64) +static if (__WORDSIZE == 64 || !__USE_FILE_OFFSET64) { ino_t st_ino; } @@ -360,7 +360,7 @@ version (CRuntime_Glibc) uid_t st_uid; gid_t st_gid; c_ulong st_rdev; -static if (!__USE_FILE_OFFSET64) +static if (__WORDSIZE == 64 || !__USE_FILE_OFFSET64) { uint[2] st_pad2; off_t st_size; @@ -394,7 +394,7 @@ version (CRuntime_Glibc) } blksize_t st_blksize; uintst_pad4; -static if (!__USE_FILE_OFFSET64) +static if (__WORDSIZE == 64 || !__USE_FILE_OFFSET64) { blkcnt_tst_blocks; } This patch can solve this problem: of course, we need to back port it to gcc-10/gcc-11 also. The problem is due to that: 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.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 ibuclaw at gcc dot gnu.org changed: What|Removed |Added CC||ibuclaw at gcc dot gnu.org --- Comment #5 from ibuclaw at gcc dot gnu.org --- (In reply to YunQiang Su from comment #4) > but where is the stat_t of D is defined? In libphobos/libdruntime/core/sys/posix/sys/stat.d
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #4 from YunQiang Su --- but where is the stat_t of D is defined?
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 --- Comment #3 from YunQiang Su --- I got it. it is not due to gcc itself, while due to *stat problem in glibc 2.33 for MIPS64. It seems we introduce a bug when try to fix y2106 problem for mips64. I am try to dig it.
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 YunQiang Su changed: What|Removed |Added CC||syq at debian dot org --- Comment #2 from YunQiang Su --- root@sid-mips64el:/build/gcc-12/gcc-12-12-20211211# /build/gcc-12/gcc-12-12-20211211/build/./gcc/gdc -B/build/gcc-12/gcc-12-12-20211211/build/./gcc/ -B/usr/mips64el-linux-gnuabi64/bin/ -B/usr/mips64el-linux-gnuabi64/lib/ -isystem /usr/mips64el-linux-gnuabi64/include -isystem /usr/mips64el-linux-gnuabi64/sys-include -isystem /build/gcc-12/gcc-12-12-20211211/build/sys-include -fno-checking -c -fno-druntime -nostdinc -I /build/gcc-12/gcc-12-12-20211211/src/libphobos/libdruntime -g -O2 xx.d read error: Success read error: Success d21: error: unable to read module 'xx' d21: note: Expected 'xx.d' or 'xx/package.d' in one of the following import paths: import path[0] = /build/gcc-12/gcc-12-12-20211211/src/libphobos/libdruntime
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 Martin Liška changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed||2021-12-07 CC||marxin at gcc dot gnu.org Status|UNCONFIRMED |WAITING --- Comment #1 from Martin Liška --- Can you please paste output of config.log file?
[Bug d/103604] [12 Regression] trunk 20210506 fails to build in libphobos on mips64el-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103604 Richard Biener changed: What|Removed |Added Target Milestone|--- |12.0