package/glibc: fix struct stat for microblaze with largefile
PATCH 1/1 package/glibc: fix struct stat for microblaze with largefile
On microblaze, there is a separate version of struct stat for largefile and for non-largefile. When the struct was updated to include the st_mtim, st_atim and st_ctim members for POSIX, the largefile version was forgotten. Since we only use largefile in Buildroot, that means that microblaze didn't have these members in struct stat. This breaks the build of some packages.
Change the define around st_mtim etc. to __USE_XOPEN2K8 to enable it in posix context (i.e. by default).
Fixes:
- http://autobuild.buildroot.org/results/dd944a3bd4ac0c94b2bec8ac209100daaf43903d (zstd)
- http://autobuild.buildroot.org/results/4609c8e2af24d9536eb33397a4659ad740aca742 (dieharder)
--- ...ot-posix-conformant-on-microblaze-wi.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch
package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch new file +37 -0
@@ -0,0 +1,37 @@ +From 87d415cc133ff493ccd02464c061cb171d11ef2f Mon Sep 17 00:00:00 2001 +From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]> +Date: Mon, 25 Jul 2022 11:25:15 +0200 +Subject: [PATCH] struct stat is not posix conformant on microblaze with + __USE_FILE_OFFSET64 + +Commit a06b40cdf5ba0d2ab4f9b4c77d21e45ff284fac7 updated stat.h to use +__USE_XOPEN2K8 instead of __USE_MISC to add the st_atim, st_mtim and +st_ctim members to struct stat. However, for microblaze, there are two +definitions of struct stat, depending on the __USE_FILE_OFFSET64 macro. +The second one was not updated. + +Change __USE_MISC to __USE_XOPEN2K8 in the __USE_FILE_OFFSET64 version +of struct stat for microblaze. + +Upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=29403 +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> +--- + sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +index a2787e88343..850697f4fa6 100644 +--- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h ++++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +@@ -89,7 +89,7 @@ struct stat + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad3; + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +-# ifdef __USE_MISC ++# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + * equivalent to 'struct timespec'. This is the type used + * whenever possible but the Unix namespace rules do not allow the +-- +2.35.3 +
Signature · 6 lines
2.35.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Arnout,
Le 25/07/2022 à 12:07, Arnout Vandecappelle (Essensium/Mind) a écrit :
Quoted 9 lines
On microblaze, there is a separate version of struct stat for largefile and for non-largefile. When the struct was updated to include the
st_mtim,st_atimandst_ctimmembers for POSIX, the largefile version was forgotten. Since we only use largefile in Buildroot, that means that microblaze didn't have these members in struct stat. This breaks the build of some packages.Change the define around
st_mtimetc. to__USE_XOPEN2K8to enable it in posix context (i.e. by default).
It means that glibc for microblaze with largefile support fail to build some packages since 2.22 (released in 2015).
Best regards,
Romain
Quoted 46 lines
Fixes:
- http://autobuild.buildroot.org/results/dd944a3bd4ac0c94b2bec8ac209100daaf43903d (zstd)
- http://autobuild.buildroot.org/results/4609c8e2af24d9536eb33397a4659ad740aca742 (dieharder)Cc Fabrice Fontaine <[email protected]>Cc Romain Naour <[email protected]>--- ...ot-posix-conformant-on-microblaze-wi.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patchpackage/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch new file +27
-0@@ -0,0 +1,37 @@ +From 87d415cc133ff493ccd02464c061cb171d11ef2f Mon Sep 17 00:00:00 2001 +From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]> +Date: Mon, 25 Jul 2022 11:25:15 +0200 +Subject: [PATCH] struct stat is not posix conformant on microblaze with + __USE_FILE_OFFSET64 + +Commit a06b40cdf5ba0d2ab4f9b4c77d21e45ff284fac7 updated stat.h to use +__USE_XOPEN2K8 instead of __USE_MISC to add the st_atim, st_mtim and +st_ctim members to struct stat. However, for microblaze, there are two +definitions of struct stat, depending on the __USE_FILE_OFFSET64 macro. +The second one was not updated. + +Change __USE_MISC to __USE_XOPEN2K8 in the __USE_FILE_OFFSET64 version +of struct stat for microblaze. + +Upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=29403 +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> +--- + sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +index a2787e88343..850697f4fa6 100644 +--- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h ++++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +@@ -89,7 +89,7 @@ struct stat + __blksize_t st_blksize; /* Optimal block size for I/O. */
package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch line 37
Quoted 10 lines
package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch new file +10
-0+ int __pad3; + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */ +-# ifdef __USE_MISC ++# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + * equivalent to 'struct timespec'. This is the type used + * whenever possible but the Unix namespace rules do not allow the +-- +2.35.3 +
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 10 lines · Romain Naour
Hello Arnout,
Le 25/07/2022 à 12:07, Arnout Vandecappelle (Essensium/Mind) a écrit :
Quoted 7 lines
On microblaze, there is a separate version of struct stat for largefile and for non-largefile. When the struct was updated to include the
st_mtim,st_atimandst_ctimmembers for POSIX, the largefile version was forgotten. Since we only use largefile in Buildroot, that means that microblaze didn't have these members in struct stat. This breaks the build of some packages.
Quoted 5 lines
Quoted 2 lines
Change the define around
st_mtimetc. to__USE_XOPEN2K8to enable it in posix context (i.e. by default).It means that glibc for microblaze with largefile support fail to build some packages since 2.22 (released in 2015).
Yep. But we didn't build microblaze with glibc until recently, so we never
noticed.
There's a related note I forgot to add to my patch. This patch fixes the issue
for internal toolchains, but of course not for external toolchain. We have just one predefined external toolchain that is in this situation, bootlin microblaze glibc. That one should be updated in September or so. I think we can live with this problem (which existed for years) a few months longer. So I marked Fabrice's workarounds for zstd and dieharder as Superseded.
Regards,
Arnout
Quoted 54 lines
Reviewed-by Romain Naour <[email protected]>Best regards,
RomainQuoted 48 lines
Fixes:
- http://autobuild.buildroot.org/results/dd944a3bd4ac0c94b2bec8ac209100daaf43903d (zstd)
- http://autobuild.buildroot.org/results/4609c8e2af24d9536eb33397a4659ad740aca742 (dieharder)Cc Fabrice Fontaine <[email protected]>Cc Romain Naour <[email protected]>--- ...ot-posix-conformant-on-microblaze-wi.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+)create mode 100644
package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patchpackage/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch new file +29
-0@@ -0,0 +1,37 @@ +From 87d415cc133ff493ccd02464c061cb171d11ef2f Mon Sep 17 00:00:00 2001 +From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]> +Date: Mon, 25 Jul 2022 11:25:15 +0200 +Subject: [PATCH] struct stat is not posix conformant on microblaze with + __USE_FILE_OFFSET64 + +Commit a06b40cdf5ba0d2ab4f9b4c77d21e45ff284fac7 updated stat.h to use +__USE_XOPEN2K8 instead of __USE_MISC to add the st_atim, st_mtim and +st_ctim members to struct stat. However, for microblaze, there are two +definitions of struct stat, depending on the __USE_FILE_OFFSET64 macro. +The second one was not updated. + +Change __USE_MISC to __USE_XOPEN2K8 in the __USE_FILE_OFFSET64 version +of struct stat for microblaze. + +Upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=29403 +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> +--- + sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +index a2787e88343..850697f4fa6 100644 +--- a/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h ++++ b/sysdeps/unix/sysv/linux/microblaze/bits/struct_stat.h +@@ -89,7 +89,7 @@ struct stat + __blksize_t st_blksize; /* Optimal block size for I/O. */ + int __pad3; + __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
Quoted 9 lines
package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch line 37
Quoted 8 lines
package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch new file +8
-0+-# ifdef __USE_MISC ++# ifdef __USE_XOPEN2K8 + /* Nanosecond resolution timestamps are stored in a format + * equivalent to 'struct timespec'. This is the type used + * whenever possible but the Unix namespace rules do not allow the +-- +2.35.3 +
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:
On microblaze, there is a separate version of struct stat for largefile and for non-largefile. When the struct was updated to include the
st_mtim,st_atimandst_ctimmembers for POSIX, the largefile version was forgotten. Since we only use largefile in Buildroot, that means that microblaze didn't have these members in struct stat. This breaks the build of some packages.Change the define around
st_mtimetc. to__USE_XOPEN2K8to enable it in posix context (i.e. by default).
Quoted 7 lines
Fixes:
- http://autobuild.buildroot.org/results/dd944a3bd4ac0c94b2bec8ac209100daaf43903d (zstd)
- http://autobuild.buildroot.org/results/4609c8e2af24d9536eb33397a4659ad740aca742 (dieharder)Cc Fabrice Fontaine <[email protected]>Cc Romain Naour <[email protected]>
Committed to 2022.05.x and 2022.02.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot