[Buildroot] [PATCH 01/11] package/libselinux: fix build issues caused by 3.8.1 bump
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Mon Sep 15 06:06:05 UTC 2025
Hello Julien,
+Waldemar in Cc, uClibc-ng related issue.
On Mon, 15 Sep 2025 00:28:28 +0200
Julien Olivain <ju.o at free.fr> wrote:
> I applied the full series to master, thanks.
Thanks!
> While reviewing, I found one corner case build failure with libselinux
> 3.9
> on x86_64 uclibc. See:
> https://gitlab.com/jolivain/buildroot/-/jobs/11350151899
>
> It seems to be a followup issue related to the one fixed in this patch.
Dammit. I must say I don't quite grasp what they are trying to do in
these matchpathcon.c checks.
It seems like:
#if (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && defined(__INO64_T_TYPE) && !defined(__INO_T_MATCHES_INO64_T)
/* alias defined in the public header but we undefine it here */
#undef matchpathcon_filespec_add
/* ABI backwards-compatible shim for non-LFS 32-bit systems */
static_assert(sizeof(unsigned long) == sizeof(__ino_t), "inode size mismatch");
static_assert(sizeof(unsigned long) == sizeof(uint32_t), "inode size mismatch");
static_assert(sizeof(ino_t) == sizeof(ino64_t), "inode size mismatch");
static_assert(sizeof(ino64_t) == sizeof(uint64_t), "inode size mismatch");
is for 32-bit systems? And here you are building for x86-64, but it
gets detected as a 32-bit system, or something like that. Is it due to
the fact that we always build with _FILE_OFFSET_BITS=64 even on 64-bit
systems, where I guess it doesn't make sense because off_t is anyway
going to always be 64-bit.
And indeed, the check used to be:
-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && __BITS_PER_LONG < 64
+#if (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && !defined(__INO_T_MATCHES_INO64_T)
which would be false on 64-bit platforms... but now is true on
uClibc-ng.
That check was "improved" for musl:
-#if (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && !defined(__INO_T_MATCHES_INO64_T)
+#if (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && defined(__INO64_T_TYPE) && !defined(__INO_T_MATCHES_INO64_T)
So I guess some additional tweak is needed for uClibc-ng.
I'm not sure what the correct fix is.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
More information about the buildroot
mailing list