Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
To: buildroot@buildroot.org
Cc: Romain Naour <romain.naour@gmail.com>,
	Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: [Buildroot] [PATCH] package/glibc: fix struct stat for microblaze with largefile
Date: Mon, 25 Jul 2022 12:07:45 +0200	[thread overview]
Message-ID: <20220725100745.2878896-1-arnout@mind.be> (raw)

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)

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Romain Naour <romain.naour@gmail.com>
---
 ...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

diff --git a/package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch b/package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch
new file mode 100644
index 0000000000..9797f3a935
--- /dev/null
+++ b/package/glibc/0002-struct-stat-is-not-posix-conformant-on-microblaze-wi.patch
@@ -0,0 +1,37 @@
+From 87d415cc133ff493ccd02464c061cb171d11ef2f Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
+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) <arnout@mind.be>
+---
+ 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
+
-- 
2.35.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2022-07-25 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 10:07 Arnout Vandecappelle (Essensium/Mind) [this message]
2022-07-25 10:24 ` [Buildroot] [PATCH] package/glibc: fix struct stat for microblaze with largefile Romain Naour
2022-07-25 10:36   ` Arnout Vandecappelle
2022-08-17  6:38 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220725100745.2878896-1-arnout@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=romain.naour@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox