From: "J. Neuschäfer via buildroot" <buildroot@buildroot.org>
To: Waldemar Brodkorb <wbx@openadk.org>
Cc: "J. Neuschäfer" <j.neuschaefer@gmx.net>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2] package/uclibc: fix missing m_tim issue
Date: Wed, 7 Aug 2024 00:57:24 +0200 [thread overview]
Message-ID: <ZrKqVEnoFgE28KWI@probook> (raw)
In-Reply-To: <ZrH+30Im+xoA7Ipw@waldemar-brodkorb.de>
On Tue, Aug 06, 2024 at 12:45:51PM +0200, Waldemar Brodkorb wrote:
> Hi Baruch,
> Baruch Siach wrote,
>
> > Hi Waldemar,
> >
> > On Mon, Aug 05 2024, Waldemar Brodkorb wrote:
> > > Patch from upstream to fix missing m_tim issue.
> > >
> > > Fixes:
> > > - http://autobuild.buildroot.org/results/f07d6d6ae2331f9972974093c0503b9d3c6b914a/
> >
> > The autobuilder started showing failures like:
> >
> > In file included from /home/autobuild/autobuild/instance-12/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/sys/stat.h:106,
> > from /home/autobuild/autobuild/instance-12/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/fcntl.h:37,
> > from libslack/fio.c:72:
> > /home/autobuild/autobuild/instance-12/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/bits/stat.h:201:9: error: expected ':', ',', ';', '}' or '__attribute__' before '.' token
> > 201 | int st_atime;
> > | ^~~~~~~~
> >
> > This is from
> > http://autobuild.buildroot.net/results/f3b3942b6b645d9523ab08d179a3f8aca7d6641c/
> >
> > Is this patch related to that issue?
>
> Good catch. It is related, I removed the patch and then the compile
> works. But I don't understand why it fails.
> @J.: Do you see why it fails for mips64el (n32)?
I found the issue: In the per-architecture stat.h files that I patched,
there are sections like:
#ifdef __USE_MISC
/* Nanosecond resolution timestamps are stored [...] */
struct timespec st_atim; /* Time of last access. */
struct timespec st_mtim; /* Time of last modification. */
struct timespec st_ctim; /* Time of last status change. */
# define st_atime st_atim.tv_sec /* Backward compatibility. */
# define st_mtime st_mtim.tv_sec
# define st_ctime st_ctim.tv_sec
#else
__time_t st_atime; /* Time of last access. */
unsigned long int st_atimensec; /* Nscecs of last access. */
__time_t st_mtime; /* Time of last modification. */
unsigned long int st_mtimensec; /* Nsecs of last modification. */
__time_t st_ctime; /* Time of last status change. */
unsigned long int st_ctimensec; /* Nsecs of last status change. */
#endif
I tried to change all instances of "#ifdef __USE_MISC" to
"#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)", but I missed some,
because MIPS has four of them (for the different ABI variants), and I
patched only the first two.
I think my original patch is salvageable, but it needs a follow-up for
MIPS and a few other architectures:
$ find libc/sysdeps/ -name stat.h | xargs grep __USE_MISC
libc/sysdeps/linux/sparc64/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/sparc64/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/common-generic/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/common-generic/bits/stat.h:# if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/powerpc/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/powerpc/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/m68k/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/m68k/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/x86_64/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/x86_64/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/mips/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/mips/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/mips/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/mips/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/common/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/common/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/sparc/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/sparc/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/nds32/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/nds32/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/xtensa/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/xtensa/bits/stat.h:#ifdef __USE_MISC
libc/sysdeps/linux/ia64/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/ia64/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/kvx/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/kvx/bits/stat.h:# if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/alpha/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/frv/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
libc/sysdeps/linux/frv/bits/stat.h:#if defined(__USE_MISC) || defined(__USE_XOPEN2K8)
I'll see when I get around to sending the follow-up patch.
-- jn
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-08-06 22:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 6:20 [Buildroot] [PATCH v2] package/uclibc: fix missing m_tim issue Waldemar Brodkorb
2024-08-05 7:15 ` Thomas Petazzoni via buildroot
2024-08-06 5:43 ` Baruch Siach via buildroot
2024-08-06 10:45 ` Waldemar Brodkorb
2024-08-06 22:57 ` J. Neuschäfer via buildroot [this message]
2024-08-12 19:27 ` Thomas Petazzoni via buildroot
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=ZrKqVEnoFgE28KWI@probook \
--to=buildroot@buildroot.org \
--cc=j.neuschaefer@gmx.net \
--cc=wbx@openadk.org \
/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