From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/e2tools: fix build with uClibc on mips64
Date: Fri, 18 Sep 2026 21:45:35 +0200 [thread overview]
Message-ID: <aq2UaCJzYpQBy_XZ@windsurf> (raw)
In-Reply-To: <20260908132030.3792569-1-yegorslists@gmail.com>
Hello Yegor,
(+Waldemar in Cc)
On Tue, Sep 08, 2026 at 03:20:30PM +0200, Yegor Yefremov via buildroot wrote:
> diff --git a/package/e2tools/0001-write-do-not-pass-struct-stat-st_size-to-store_data.patch b/package/e2tools/0001-write-do-not-pass-struct-stat-st_size-to-store_data.patch
> new file mode 100644
> index 0000000000..86dd01192c
> --- /dev/null
> +++ b/package/e2tools/0001-write-do-not-pass-struct-stat-st_size-to-store_data.patch
> @@ -0,0 +1,74 @@
> +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> +From: Yegor Yefremov <yegorslists@googlemail.com>
> +Date: Tue, 8 Sep 2026 12:00:00 +0200
> +Subject: [PATCH] write: do not pass &statbuf.st_size to store_data()
> +
> +store_data() takes an 'off_t *', but put_file() hands it the address of
> +'statbuf.st_size', whose type is whatever the C library declares in
> +'struct stat'. Those two types are not required to match: on mips64
> +uClibc-ng declares 'struct stat::st_size' as '__off_t' (long int), while
> +'_FILE_OFFSET_BITS=64' makes 'off_t' an alias of '__off64_t' (long long
> +int). Both are 64 bit wide, but they are distinct types, so gcc 14 and
> +later reject the call:
Are you sure this is the correct fix?
When I look at stat(3type) it says:
struct stat {
dev_t st_dev; /* ID of device containing file */
ino_t st_ino; /* Inode number */
mode_t st_mode; /* File type and mode */
nlink_t st_nlink; /* Number of hard links */
uid_t st_uid; /* User ID of owner */
gid_t st_gid; /* Group ID of owner */
dev_t st_rdev; /* Device ID (if special file) */
off_t st_size; /* Total size, in bytes */
So st_size is an off_t, so passing &blabla.st_size to a function
expecting an off_t* should always work.
And the fact that this (apparently) only occurs on uClibc makes me
think that this is more likely a uClibc bug.
Waldemar, do you have any thoughts?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-09-18 19:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 13:20 [Buildroot] [PATCH] package/e2tools: fix build with uClibc on mips64 Yegor Yefremov via buildroot
2026-09-18 19:45 ` Thomas Petazzoni via buildroot [this message]
2026-09-19 6:40 ` Waldemar Brodkorb
2026-09-19 6:52 ` Yegor Yefremov 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=aq2UaCJzYpQBy_XZ@windsurf \
--to=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yegorslists@googlemail.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